I am creating transporter object using code in the OnModelReset trigger. I would like to add logic for On Resource Available trigger when I create transporters. how to add the trigger using code?
I am creating transporter object using code in the OnModelReset trigger. I would like to add logic for On Resource Available trigger when I create transporters. how to add the trigger using code?
You can use the Object.setProperty() method. For example, this code snippet will give the transporter an OnReset trigger that sets its color to red and an OnResourceAvailable trigger that sets its color to blue:
Object obj = Model.find("Transporter1"); obj.setProperty("Triggers.OnReset", "Dispatcher current = ownerobject(c); current.color = Color.red;"); obj.setProperty("Triggers.OnResourceAvailable", "Dispatcher current = ownerobject(c); current.color = Color.blue;");
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