question

royjuventus29 avatar image
1 Like"
royjuventus29 asked Jason Lightfoot commented

How to get the "Unit" of an object property value

FlexSim 24.0.1
flexsim script
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

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Jason Lightfoot commented

You need to pass the GET_PROPERTY_FLAG_UNITS flag into the Object.getProperty() method.

If you pass that flag it will return a 2-length array with the display value in the first element and the display units in the second. Without that flag it will return the value in model units.

For example, say you set the Process Time of Processor1 to be 10 minutes in a model with seconds as the model time unit. Then the getProperty method will return:

  1. Object obj = Model.find("Processor1");
  2. obj.getProperty("ProcessTime", GET_PROPERTY_FLAG_UNITS); // [10, min]
  3. obj.getProperty("ProcessTime"); // 600


· 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.