question

jurajzilka avatar image
0 Likes"
jurajzilka asked jurajzilka commented

Associate objects to control variable

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

FlexSim 23.1.1
emulationassociate objectchange 3d shape
default-box.png (71.3 KiB)
change-3d-shape.png (71.0 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

·
Jeanette F avatar image
0 Likes"
Jeanette F answered jurajzilka commented

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


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

jurajzilka avatar image jurajzilka commented ·

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 0 ·
modeltree.png (21.0 KiB)
Jeanette F avatar image Jeanette F ♦♦ jurajzilka commented ·

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.

1 Like 1 ·
jurajzilka avatar image jurajzilka Jeanette F ♦♦ commented ·
Oh, I can see now. Anyway, thank you for your time and help. :)
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.