How do I change the color of the patient shirt?

How do I change the color of the patient shirt?

tee_hiett
Not applicable
70 Views
3 Replies
Message 1 of 4

How do I change the color of the patient shirt?

tee_hiett
Not applicable

[ FlexSim 19.1.1 ]

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

0 Likes
Accepted solutions (1)
71 Views
3 Replies
Replies (3)
Message 2 of 4

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

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.

21953-changeshirtcolor.png

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.



Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 3 of 4

tee_hiett
Not applicable

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
Message 4 of 4

Matthew_Gillespie
Autodesk
Autodesk

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.)



Matthew Gillespie
FlexSim Software Developer

0 Likes