Merging items in rack

Merging items in rack

Guldberg.dk
Contributor Contributor
129 Views
5 Replies
Message 1 of 6

Merging items in rack

Guldberg.dk
Contributor
Contributor

[ FlexSim 21.2.4 ]

I have a model, where once the items are placed in a rack in and once they reach a predetermined height (1.2m/3 grey or 4 red totes), they are removed again and put on a pallet (once there is enough for a full pallet = 4 stacks), but they are handled as one seperate unit and as such moved as one and combined on the pallet as one.


1636548216940.png


Can I merge/group items (similar to what the combiner is doing) in script? I dont need to seperate them again, so in theory I could probably destroy them and create a new object. Im just hoping there is a better way,

Totesorter_2.fsm

0 Likes
130 Views
5 Replies
Replies (5)
Message 2 of 6

joerg_vogel_HsH
Mentor
Mentor

Here is an example for a queue stacking items together.

The code is in the On Entry trigger

Combine_items_by_code.fsm

0 Likes
Message 3 of 6

Guldberg.dk
Contributor
Contributor

Cool. As I understand it, you change the parent of the item you want to move into the item you want to move it into right?

I kinda got it working, joing all items in a slot to the first item

1636568995278.png

But wierd stuff happens. First of all, when the container item is moved from the slot, the boxes jumps all over the place. Secondly, the next item that enteres that same slot is placed in the top of the slot (I think its the position of the top most box that was just removed). Im clueless to why. Any ideas?

1636569290287.png

1636569356366.png

1636569409415.png

Totesorter_3.fsm

0 Likes
Message 4 of 6

joerg_vogel_HsH
Mentor
Mentor
A rack or the warehouse in general keeps storing the items in a slot you have assigned. You must set the assigned slot for each item leaving your warehouse to null. The storage systems thinks, that the combined items are still in the rack.
0 Likes
Message 5 of 6

Guldberg.dk
Contributor
Contributor
Fair. How do you null / destroy the storage items? I tried various methods with no luck on the OnSlotExit trigger.


Also any idea whats causing the boxes to change positions when being picked up?

0 Likes
Message 6 of 6

moehlmann_fe
Enthusiast
Enthusiast

If you use "moveobject()" to move the items into the first instead of setting the parent via "item.up" the references to the item in the storage system will be correctly removed since the item "exited" the rack.

The items change position because they are restacked when the first item leaves the rack. So their coordinates are set to what they would be in the rack. You can check this by deactivating the "Automatically Restack Items" option the storage system properties.

1636615893779.png

Again, this is not necessary when using "moveobject()". The code has to be adjusted though, since the item can't be referenced through the slot anymore after moving it.

int slotItemQty = slot.slotItems.length;  // get number of items beforehand
for (int n = 2; n <= slotItemQty;n++) {
Object curItem = slot.slotItems[2].item;  // get static reference to item
moveobject(curItem, slot.slotItems[1].item); // move item into first item (container)
double locZ = slot.slotItems[1].item.as(Object).size.z; // height of first combined item
if(n > 2) // same code level as top, but related to first subnode level
locZ = slot.slotItems[1].item.subnodes[n-2].as(Object).getLocation(0,0,1).z;// height of following items
curItem.location = Vec3(0,0,locZ); // set location in container item
curItem.color = Color(0,1,0,1);
}

totesorter-4.fsm