assigning box to certain slot by FlexScript

assigning box to certain slot by FlexScript

j08j
Not applicable
8 Views
2 Replies
Message 1 of 3

assigning box to certain slot by FlexScript

j08j
Not applicable

[ FlexSim 24.0.2 ]

I try to store 15 boxes in certain bay, level and slot, e.g. slot(2, 3, 1), by using FlexScript. But it stored all boxes in slot(1, 1, 1), which is not follow the assignment.

screenshot-2024-03-19-at-23154-pm.png

Test_1.fsm

0 Likes
Accepted solutions (1)
9 Views
2 Replies
Replies (2)
Message 2 of 3

moehlmann_fe
Observer
Observer
Accepted solution

To assign a slot to an item you need a pointer reference to that item. Which your code doesn't have. This also means that the item must exist in the first place, so you can't assign slots before the start of the model. It has to happen during the runtime.

One option would be to assign the slot in the On Creation trigger of the source. This trigger provides a pointer to the created item.

1710838202222.png

0 Likes
Message 3 of 3

j08j
Not applicable

Thanks a lot. That's worked fine!

0 Likes