Hello,
I am trying to limit the height of boxes stacked in a queue by keeping track of the height of boxes in the queue. See below for the custom code I am currently using. I am adding the height of the box to a label on the queue itself. I also want to take away height from the queue when the box leaves. The problem is if I use the same thought process for reducing the height of the queue it doesn't work. I am looking at the z-location of the box plus the box height to check if the height label needs to be changed. Since I am using Process Flow to create the boxes it unloads the boxes in the queue from the bottom up. Can anyone come up with a method to decrease the height of the queue as well as increase it when it needs to? My goal is allow the queue to reduce to zero then repopulate the queue with process flow. Queue batching may be useful but the box entering can be a different size so I don't know the exact content of the queue. I would like the box to fill the entire queue just up to a certain number of stacked boxes high.
Thanks,
Zach Bell
Queue OnEntry
/**Custom Code*/
Object current = ownerobject(c);
Object item = param(1);
int port = param(2);
updatelocations(item);
if(item.location.z + item.size.z > current.CurrentHeight)
(
(current.CurrentHeight = item.location.z + item.size.z)
);
Incorrect Queue OnExit
/**Custom Code*/
Object current = ownerobject(c);
Object item = param(1);
int port = param(2);
updatelocations(item);
if(current.CurrentHeight/item.size.z < )
(
(current.CurrentHeight = current.CurrentHeight - item.size.z)
);