How can I change the color of a conveyor based on the number of items on that? For instance, in the attached model, I want the conveyor color changed to red when it's carrying more than 4 items. I would appreciate any help.
How can I change the color of a conveyor based on the number of items on that? For instance, in the attached model, I want the conveyor color changed to red when it's carrying more than 4 items. I would appreciate any help.
hi @Amir About
You can change the node control the color of conveyor, and the path is MODEL:/Conveyor1>variables/localType/drawColor
I attached the modified model.
If the conveyor type is not "custom", you should find the node in MODEL:/ConveyorSystem>variables/conveyorTypes/ConveyorType1
Thanks @jing.chen.
The modified model does exactly what I need. Can you please explain three custom codes in the derision points. Some parts aren't clear to me:
DP1 (On Arrival):
Object current = param(1); Object item = param(2); Object conveyor = param(3); if(conveyor.subnodes.length >= 4) { treenode colornode = getvarnode(conveyor, "localType").subnodes[38]; setnodenum(first(colornode),0); }
DP11 (On Arrival):
Object current = param(1); Object item = param(2); Object conveyor = param(3); if(conveyor.subnodes.length == 4) { treenode colornode = getvarnode(conveyor, "localType").subnodes[38]; setnodenum(first(colornode),1); repaintall(); }
DP11 (On Reset):
Object current = param(1); Object conveyor = param(2); treenode colornode = getvarnode(conveyor, "localType").subnodes[38]; setnodenum(first(colornode),1);
What color of an object shown in FlexSim is based on 3 subnodes (value is 0 to 1,{1,1,1} will show white color) under the "colornode".(You can see in the pic attached)
In OnArrival of DP1 is to check the content of conveyor had come to 4 or more, if so it will set the value of any subnode of "drawColor" to 0(any value different from the original value is OK).
While in OnArrival of DP11 is to check the content of conveyor less than 4, and make it back to white color.
8 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