I have a model where I am labeling a pallet but the pallet itself already has a label and that label that the pallet has must have all the boxes it contains, how can it be done
I have a model where I am labeling a pallet but the pallet itself already has a label and that label that the pallet has must have all the boxes it contains, how can it be done
Hi @Allison_CG,
You can do this by looping through the items within the pallet and then writing a label value onto each item. The following code is an example of one way to do this.
for (int i = 1; i < token.pallet.subnodes.length; i++){ Object box = token.pallet.subnodes[i]; box.labels.assert("Type"); box.Type = token.pallet.Type; }
If you are creating the items in the pallet using a create object activity in process flow, you can add the label to the items while creating them.
You can also use a sub flow activity and loop through the items and assign a label to them while in process flow.
These are just a few ways that you can accomplish what you are trying to achieve.
The code works but now it puts the label on the box and on the stowage it gives me a value of 0
Hello @Allison_CG
Just add a line of code to assign to the pallet as well. This would be placed outside the for loop.
token.pallet.labels.assert("Type"); token.pallet.Type = value;
or an assign label activity before or after the run sublow
17 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