Associate objects to control variable

Associate objects to control variable

JurajZilka
Not applicable
5 Views
4 Replies
Message 1 of 5

Associate objects to control variable

JurajZilka
Not applicable

[ FlexSim 23.1.1 ]

I am already able to change 3D shape of one box but it works only for one. I want to know how can I associate every object that came out from source or every object in queue to control variable so I would be able to change 3D shapes of boxes on conveyor every time when I write value "1". Or if you know about better solution of my problem, please let me know. I will be grateful for any answers. default-box.png

change-3d-shape.png

associated-object.png

0 Likes
Accepted solutions (1)
6 Views
4 Replies
Replies (4)
Message 2 of 5

Jeanette_Fullmer
Community Manager
Community Manager
Accepted solution

Hello @JurajZilka,

I was able to change the associated object by finding the variable in the model tree and referencing it to set the value. I used an on entry trigger to set the value of the entering flow item to the associated object.

1683674902441.png

getvarnode(Model.find("Tools/Emulation"), "emulationVariables").as(Table)[1][13] = item;

Emulation Associated Object Variable.fsm

0 Likes
Message 3 of 5

JurajZilka
Not applicable

I don't know if it is purpose but in your attached model I can't see any differences in model tree. I still do not know how to solve my problem because when I tried to type something into object in model tree it automatically corected it. For example when I typed "/StraightConveyor1/Box" the "Box" was removed.modeltree.png

emulation-properties.png

0 Likes
Message 4 of 5

Jeanette_Fullmer
Community Manager
Community Manager

Like I mentioned above. I reference that node with code to set the value. You can't just type into the field to change it. The code is executed when an item enters the conveyor in my model. I use an on entry trigger on the conveyor.

Message 5 of 5

JurajZilka
Not applicable
Oh, I can see now. Anyway, thank you for your time and help. 🙂
0 Likes