Thanks for the response @Felix Möhlmann.
I see it works in your model, but what if I want this aggreagted count for the group of multi-processors which they alaredy have a custome code regarding the packing method on their On Entry and On Exit as below:
On Entry Custome Code:
Object current = ownerobject(c);
Object item = param(1);
int port = param(2);
Object lastitem = item.prev;
/***popup:SimplePacking*/
/**Simple Packing Method*/
/**Combine flowitems into any container. Choose a buffer for the X, Y, and Z
directions so the flowitems will not overlap with the container's edges.*/
double xBuffer = /** \nX Buffer: *//***tag:nx*//**/0.5/**/;
double yBuffer = -/** \nY Buffer: *//***tag:ny*//**/6/**/;
double zBuffer = /** \nZ Buffer: *//***tag:nz*//**/3.25/**/;
double containerSX = current.size.x - xBuffer;
double containerSY = current.size.y + yBuffer;
if(current.subnodes.length == 1) {
item.setLocation(xBuffer, yBuffer, zBuffer);
} else if (containerSX - (lastitem.location.x + lastitem.size.x + xBuffer) >= item.size.x) {
item.setLocation(lastitem.location.x + lastitem.size.x + xBuffer, lastitem.location.y, lastitem.location.z);
} else if (containerSY - (lastitem.size.y + lastitem.location.y + yBuffer) >= item.size.y) {
item.setLocation(xBuffer,(lastitem.size.y + lastitem.location.y + yBuffer + 2), lastitem.location.z);
} else {
item.setLocation(xBuffer, yBuffer, lastitem.location.z);
}
On Exit Custome Code:
/**Custom Code*/
Object current = ownerobject(c);
Object item = param(1);
int port = param(2);
Object currentItem = item.next;
double moveCurrentToX = item.location.x;
double moveCurrentToY = item.location.y;
double moveCurrentToZ = item.location.z;
double tempX = 0;
double tempY = 0;
double tempZ = 0;
while (currentItem != NULL) {
tempX = currentItem.location.x;
tempY = currentItem.location.y;
tempZ = currentItem.location.z;
currentItem.setLocation(moveCurrentToX, moveCurrentToY, moveCurrentToZ);
moveCurrentToX = tempX;
moveCurrentToY = tempY;
moveCurrentToZ = tempZ;
currentItem = currentItem.next;
}