If it's always 50/50 then you can just use round robin for the send to port and set the color and type on exit trigger based on the port. Example model attached.
There are two events that can evaluate that there are more items by split mode:
if you want to divert items an On Exit event is to late. You have to do it in function "Send To Port" in Output Properties pane.
Unfortunately there aren't any templates that allows you to manipulate labels. You have to write a source code script to assign label values right behind the header of this function source code.
AND you have to choose before you add this code your template, otherwise selecting a new template destroys any previously entered code.
AND this function gets executed for each leaving item once. This means after a first item has left this object any code will evaluate all staying items again. This said there are two scenarios in relation of counted item as staying inside of this object. Items are exiting instantly or items are waiting inside of object because they are transported or are blocked by next object entrance allowance.
forobjecttreeunder(current){ // recursively look for each object subnode at start node a.Type = a.cnt; // "a" is found object of step a.cnt +=1; // intermediate count label at item, can be destroyed on exit } item.color = Color.byNumber(item.Type);
cnt label at item must be initialized on Entry with value of 1.
code to destroy label "cnt on exit:
item.attrs.labels.subnodes["cnt"].destroy();
You can set a separator to send items in round robin fashion. And you can set a label value by local variable called "port" on Exit. And you can set by this variable name also colors of leaving objects. This is a functionality where you do not need to write source code. But this is not what you requested to achieve. This result is similar. But it is a more like creating two items from one. You send one to output port one and a second to output port two. When they are leaving you tell them to record the output port number in a label and chooose by this output port number a color. It is more a passiv observation then really actively doing something.
14 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