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.
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.
Here's an example using the Warehousing pick options in Process Flow.
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.
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.
Results in this:
Instead of this:
This is great! Thanks @phil.bobo and @anthony.johnson for all of your help with this.
@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.
16 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved