No, the character needs not be in any particular outfit first. If you are using this for your current sim, you don't have to specify their name. If you need to use this for other simmers, this cheat does not work with simmers' names, but instead, you can use that other cheat  "sims.get_sim_id_by_name FirstName LastName" to get their ids, which is what this cheat uses.