Finding the nearest open slots to an item in a rack

Finding the nearest open slots to an item in a rack

jon_abbott
Not applicable
1,580 Views
7 Replies
Message 1 of 8

Finding the nearest open slots to an item in a rack

jon_abbott
Not applicable

[ FlexSim 20.0.5 ]

Is there a way to use findSlot to identify open rack slots nearest in distance to an item that is already stored in a rack? Thanks in advance for your help.

Accepted solutions (1)
1,581 Views
7 Replies
Replies (7)
Message 2 of 8

anthony_johnsonT83CM
Autodesk
Autodesk

@Jon Abbott Here's sample code I executed in a script window:

Storage.Slot other = Model.find("Rack1").as(Storage.Object).getSlot(7, 4, 1);
return Storage.system.findSlot("ORDER BY (slot.location.project(slot.storageObject, model()) - $1.as(Storage.Slot).location.project($1.as(Storage.Slot).storageObject, model())).magnitude ASC", 0, other.as(treenode));

Or you can make a command that calculates the distance and call that from the query.

Message 3 of 8

philboboADSK
Autodesk
Autodesk
Accepted solution

@Jon Abbott

Here's an example using the Warehousing pick options in Process Flow.

28118-1588807191412.png

find_nearest_slot.fsm



Phil BoBo
Sr. Manager, Software Development
Message 4 of 8

philboboADSK
Autodesk
Autodesk

For others that may look at this question/answer, here's another example that uses the feature of using multiple Queries in Find Slot. This example will try to avoid mixing slots with different types.

First, it looks for a slot that has an item that it matches.

Then it looks for the nearest empty slot.

Finally, it looks for the nearest slot with space regardless of what is in it.

find_nearest_slot_1.fsm

Results in this:

28120-1588809826551.png

Instead of this:

28131-1588809835294.png



Phil BoBo
Sr. Manager, Software Development
0 Likes
Message 5 of 8

jon_abbott
Not applicable

This is great! Thanks @phil.bobo and @anthony.johnson for all of your help with this.

0 Likes
Message 6 of 8

anthony_johnsonT83CM
Autodesk
Autodesk

Note this example will only compare locations within the same rack. If you want to compare locations across different racks, you need to use the Vec3.project() method to translate the location from the rack's local space to the model space.

Message 7 of 8

ajdajadh1
Explorer
Explorer

I have used the model find_nearest_slot_1.fsm it works really great but for one floor storage but when i use multiple floor storage in the model it does not work. attaching my model. can anyone help.find-nearest-slot-1_Updated.fsm

0 Likes
Message 8 of 8

ajdajadh1
Explorer
Explorer
can we do it for particular rack or floor storage in model, can i know i query we need to put and where so we find the slot in that particular storage object
0 Likes