question

Kyle Y avatar image
0 Likes"
Kyle Y asked Braydn T commented

how to get slot content

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

FlexSim 20.0.0
slotcontent
storage.jpg (146.5 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

Roi Sánchez avatar image
0 Likes"
Roi Sánchez answered Braydn T commented

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

Joerg Vogel avatar image Joerg Vogel commented ·
0 Likes 0 ·
Kyle Y avatar image Kyle Y commented ·

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 0 ·
Braydn T avatar image Braydn T Kyle Y commented ·

@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 0 ·