question

Gui Vaccaro avatar image
0 Likes"
Gui Vaccaro asked Gui Vaccaro commented

How to programatically change the operator's shape (male/female)?

Hello,
What is the current way to create an operator and change it's shape (male/female)? I saw old answers in the forum, but they do not seem to be valid for recent versions.

changepersonvisuals(operatorObject, "Shape", 7);

and

shapeindex(operatorObject) = 7;

do not seem to work to bring a female shape.

Thank you for any clarification!

FlexSim 25.0.0
shapemalefemaleflexsript
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

Sebastián Cañas avatar image
0 Likes"
Sebastián Cañas answered Gui Vaccaro commented

Check the code in the Custom Code activity. Change the code according to your needs. In this demo a female or male operator is being created based on the value of Parameter1.

Female_Male_Operator.fsm


· 3
5 |100000

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

Gui Vaccaro avatar image Gui Vaccaro commented ·
Thank you, @Sebastián Cañas ! It works.

I wonder, tough, why those things are so difficult in FS :)

Thank you very much!

0 Likes 0 ·
Sebastián Cañas avatar image Sebastián Cañas Gui Vaccaro commented ·

@Gui Vaccaro ,

As a suggestion, try exploring predefined logics in Triggers, Custom Code Activities or anything that has FlexScript in it. For example, to help you with your question I didn't create the code from scratch, I used the Change 3D Shape logic that most Objects have in its triggers and adapted it.

1734646461024.png

0 Likes 0 ·
1734646461024.png (95.7 KiB)
Gui Vaccaro avatar image Gui Vaccaro Sebastián Cañas commented ·
Hi, @Sebastián Cañas , thank you. I usually do that.

However, even the predefined codes use deprecated functions (I wonder when the internal code will really be upgraded to the new APIs). Having this "noise" from deprecated functions in the snipets does not do much for the users.

Thank you again for your support.

0 Likes 0 ·