I get the current state of the crane in the model.
Then I want to add a label to the crane according to the current state of the crane
But it shows an error, how should this expression be written?
I get the current state of the crane in the model.
Then I want to add a label to the crane according to the current state of the crane
But it shows an error, how should this expression be written?
The state string value "offset travel empty" or any string has to be in double quotes.
if(Model.find("Crane3").as(Object).stats.state().valueString=="offset travel empty")
To add to this:
A slightly cleaner approach might be to use the numerical state value and compare it to the respective define. This might prevent typos and probably runs slightly faster.
if(Model.find("Crane3").as(Object).stats.state().value == STATE_OFFSET_TRAVEL_EMPTY)
Thank you very much for your guidance, but the label on the crane still does not change, what is the reason?
14 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