question

Tee Hiett avatar image
0 Likes"
Tee Hiett asked Matthew Gillespie commented

How do I change the color of the patient shirt?

21729-doctornotes.fsm

In the Escort to Exam Table section of the attached program, I have an activity to change the patient's shirt collar to green to indicate that the patient is waiting for an exam room. Unfortunately, I don't understand the syntax of the command to do that. So I'm turning to the experts again.

Thanks

FlexSim 19.1.1
change visual
21729-doctornotes.fsm (627.8 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered Matthew Gillespie commented

You're doing everything right, you're just being affected by an oversight we made when we first released 19.1. When we first released, all of the people's clothes used their own colors and none of them used the object's color. In 19.1.1 we updated it so all the shirts use the object's color rather than their own color, but models started in 19.1.0 (like yours) still have shirts using their own color.

Luckily it's not too hard to set the shirt to use the object's color and I did it for you in the attached model.

doctornotes-colorshirt.fsm

To change that setting expand the FlowItem Bin in the Toolbox and double click on Patient. Find the Shirt field in the Person Visuals panel and click the drop down arrow button. Then check the Use Object Color checkbox in the popup.

That checkbox should be checked for people's shirts in all models made in 19.1.1 or later so you shouldn't have to do this step just to change a shirt color. However, you could do these same steps to make other parts of the person's clothing use the object color too.


· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Tee Hiett avatar image Tee Hiett commented ·

Thanks, Matthew. Works like a charm. Also good additional information.

Just out of curiosity, what would be the syntax of a command just to change the color of the shirt?

Tee

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Tee Hiett commented ·

If the shirt has the Use Object Color box checked you can just set the object's color:

patient.as(Object).color = Color.red;

Otherwise you need to use the changepersonvisuals() command. This command lets you change anything that you can change in that Person Visuals panel in Quick Properties:

changepersonvisuals(patient, "Shirt", 2, Color.red);

The second parameter is the category you want to change (Head, Skin, Shirt, Pants, Hair, Shoes, Glasses, Gacial Hair, or Gloves) and the third parameter is the index of the type of that category you want to set it to (e.g. for the Man under the Shirt category a 1 is the Tee shirt, 2 is the Athletic shirt, 3 is the Leather Jacket, etc.)

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.