how to get slot content

how to get slot content

kyle_y
Not applicable
11 Views
4 Replies
Message 1 of 5

how to get slot content

kyle_y
Not applicable

[ FlexSim 20.0.0 ]

Hi, I got several item on a slot. how to get the exactly number by code? Thank you.

26191-storage.jpg

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

roi_sn
Not applicable
Accepted solution

Hello @Kyle Y,
If you have the reference to the slot in, for example token label token.slot, you just need to access to the next property:

Storage.Slot slot = token.slot;
int slotContent = slot.slotItems.length;
0 Likes
Message 3 of 5

joerg_vogel_HsH
Mentor
Mentor
0 Likes
Message 4 of 5

kyle_y
Not applicable

Thank you Vogel. If I have 2 rack and each rack contain 2 levels and 7 bays, each bay contain 4 slot, and each slot have its own label("Type"). How can I go through all of the slot content? Thank you.

0 Likes
Message 5 of 5

braydn_t
Not applicable

@Kyle Y there may be some query that I am not aware of if you are searching for one in particular, but the easiest solution I can think of is some nested for loops.

0 Likes