Hello everyone. I want to know if I can change the appearance of the items on the truck?
This is the current position of the item on the truck.
But I want the items on the truck to be put in this way.
Thank you.
Hello everyone. I want to know if I can change the appearance of the items on the truck?
This is the current position of the item on the truck.
But I want the items on the truck to be put in this way.
Thank you.
I did this a while ago when I first started using FlexSim, so there may be a better way to do this, but if you put this code in your truck's OnLoad trigger and set the 4 global variables on the left as follows, it will work for you, after you tweak the values to make it fit YOUR truck, of course.
Global Variables:
lastItem: Type = treenode, value = null
itemNumber: Type = integer, value = 1
lastItem2:Type = treenode, value = null
itemNumber2: Type = integer, value = 1
Nice solution, but can I recommend to use labels instead of global variables here? You will run into problems if you need a second truck in the model. Instead of writing "lastItem" just write "current.lastItem" everywhere, to give the truck a local set of values.
100% agree! And exactly to your point (I missed this when pulling this file up), I only use lastItem2 and itemNumber2 in this script because this IS a second truck in that model haha. So yeah @joey , definitely take @Mischa Spelt's advice and use labels instead of global variables!
HI @Mischa Spelt @Aaron C Thank you for a good idea, but I don't understand. I set the value in OnLoad trigge, but it's not successful or I'm wrong. Please also give me more advice. Thank you in advance for help.
Hi @joey ,
Since you didn't upload your model I am not sure what goes wrong in your case. But I have made an example model (see attachment) that uses label values on the truck. I have added a reset trigger and a on load trigger to the truck. So if you copy this it should work for your truck as well (you might need to change the default values I use in de onReset trigger, since you truck will be different.
If it is not clear, of if you want to know what goes wrong in your model please let me know.
12 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