Calculated parameters in Python

Calculated parameters in Python

patryk_u2
Not applicable
110 Views
3 Replies
Message 1 of 4

Calculated parameters in Python

patryk_u2
Not applicable

[ FlexSim 23.2.1 ]

I would like to use python code to enumerate parameters in flexsim.

In this way, I send the given parameters in this example, type and weight, to Python and it returns me a calculated value that I can use in the model.

Is there a way to do this ?

1705065670639.png

python-test.fsm:

pyfunction.py

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

jason_lightfoot_adsk
Autodesk
Autodesk
Accepted solution

Your use command should only contain this:

/**external python: */ /**/"pyfunction"/**/
/** \nfunction name:*/ /**/"Flex"/**/

But you should specify the parameter types in the command gui:

1705066831155.png

0 Likes
Message 3 of 4

patryk_u2
Not applicable

After he changed use command I have this error
1705141855410.png

0 Likes
Message 4 of 4

jason_lightfoot_adsk
Autodesk
Autodesk
Check that the code has been applied in the UserCommand Gui as well as the code gui, and that the python module is in the same directory as the model.
0 Likes