Hello, I have model where I am assigning label to flowitem Box as Part_num and Loc(location) where it should read Part_Num as part names and location where it is located how can I assign that with code. Simple model attached.
Hello, I have model where I am assigning label to flowitem Box as Part_num and Loc(location) where it should read Part_Num as part names and location where it is located how can I assign that with code. Simple model attached.
The 'Part_num' label can be assigned in the 'On Creation' trigger of the source.
For the location label, you can use the 'On Entering' trigger of the flow item itself to update the label each time the item enters into an object. (I guess you could also assign the 'Part_num' label there, if the item directly enters an object after being created.)
Alternatively, you could also set both labels up as FlexScript labels that get evaluated each time their value is accessed. So 'item.Loc' for instance would return the current container object. However, the value would not appear in the labels table of the item. (See the cylinder flow item in the attached model)
Do you mean assign the location to the item on a pallet or to the pallet itself?
For the first, you either keep the current logic, which will then display the pallet as well as its container object in the label.
To only get the object the pallet is currently in on the items on it, you will have to use the second option of using FlexScript labels and modify them to go up one level further if the container object is a pallet.
(If the pallets have a different name you have to adjust the condition to fit your model)
You can use the same logic the boxes uses to assign the location to the pallet directly. I didn't actually know that the triggers were missing from the GUI of container flow items in the 2020 version. The event still works though. You have to manually insert the repsective node into the 'eventfunctions' subnode of the pallet. Right-click on the item in the flow item bin and open its tree (both the box (where the code is already present) and the pallet). Then navigate to the node and copy it over to the pallet's tree as shown below.
15 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