I want calling values in other user command tree nodes.
for example,In my model, I created a new treenode (called “number1”) in "command1", now I want to call this value in command2, how to write the code.
Thanks a lot.
I want calling values in other user command tree nodes.
for example,In my model, I created a new treenode (called “number1”) in "command1", now I want to call this value in command2, how to write the code.
Thanks a lot.
If you could send in your model or a sample model then we would be able to see exactly what you are trying to do. The easy answer, I think, might be to just write that value to a Global Variable instead of to a treenode?
You use the sampler tool and get a treenode reference to the node:
Model.find("Tools/UserCommands/command1/number1")
Then you need to get the value of this node:
Model.find("Tools/UserCommands/command1/number1").value
If you want to see that this works, you can write in the command2() the print command:
print(Model.find("Tools/UserCommands/command1/number1").value);
If you reset the model and execute the user command "command2()" in a script console window the value of the node is written in the output console.
13 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved