question

Zach B3 avatar image
0 Likes"
Zach B3 asked Zach B3 commented

How to use Model.find to access label contained in variable

Hello, I am trying to store a label name in a variable, and then use Model.find("object").storedLabel to change the value of the physical label. But I am unable to figure out how to do this. This is what I currently have:

When I use Model.find("InputVariableController").propertyName, this code is not accessing the physical label of the InputVariableController.

FlexSim 20.0.0
variablefindmodel.find
capture.png (24.9 KiB)
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

Regan Blackett avatar image
1 Like"
Regan Blackett answered Zach B3 commented

The syntax you would need is:

  1. Model.find(InputVariableController").labels[propertyName].value

By using the propertyName variable in the brackets like that, you searching for the string name of the label. Otherwise it assumes that the label is literally named propertyName.

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