I created a label with data type Flexscript. How do you execute it in the code of the object?
I created a label with data type Flexscript. How do you execute it in the code of the object?
Just get the value through dot syntax like you normally would:
double delay = current.ProcessingTime;
This will execute the flexscript on the ProcessingTime label if it is flexscript type and return the value.
If you want to pass in parameters you need to get the label node and call evaluate on it.
double delay = current.labels["ProcessingTime"].evaluate(5);
The method is evaluate
current.labels["MyFlexScriptLabel"].evaluate();
or
nodefunction(node("MyFlexScriptLabel",labels(current));
I was not able to pass parameters into the function similar to the description of the manual.
You specified param(0) to try to get the parameter. Parameters start at 1. Use param(1):
Thanks Phil. I set the parameter to 1 today in the morning. I didn't get any results, now after loading the model again everything is fine.
9 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