question

Kyle Y avatar image
0 Likes"
Kyle Y asked Joerg Vogel commented

how to get exactly content of 4 storage type rack?

Hi, if I have 4 rack(rack1, rack2, rack3, rack4) 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.

FlexSim 20.0.0
storage
5 |100000

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

Steven Hamoen avatar image
1 Like"
Steven Hamoen answered Joerg Vogel commented

@Kyle Y @Braydn T

Can't you use the Storage.System.queryItems() ? It will return an array with all items, which you can search. There are also other Storage.System methods you can use that might help without having to create for loops.

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

As @steven.hamoen suggested, I filter an array by a Table.query to count items of Type 2. But it was a bit difficult to eliminate queries which returns NULL.

Instead of COUNT you can return an array of slotitems. The attached model contains both variants. queryitemsbytype.fsm

0 Likes 0 ·
Braydn T avatar image
0 Likes"
Braydn T answered

@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, using the command Storage.Slot.slotitems, and the .length command.

5 |100000

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

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.