Hello everyone,
I need to create a table using FlexScript and this table has to reset some values to 0 on Reset.
How do I trigger an event On Reset when I create a global table?
Thank you!
Hello everyone,
I need to create a table using FlexScript and this table has to reset some values to 0 on Reset.
How do I trigger an event On Reset when I create a global table?
Thank you!
A table you create through Tools.create() will have a "resettrigger" node in its variables. Write the needed code to that node as a string and switch the node to flexscript.
- Object newTable = Tools.create("GlobalTable");
- treenode resetTrigger = getvarnode(newTable, "resettrigger");
- // Add code that resets the first column to 0
- resetTrigger.value = "Table current = param(1);\
- for(int row = 1; row <= current.numRows; row++) {\
- current[row][1] = 0;\
- }";
- // Switch to flexscript
- switch_flexscript(resetTrigger, 1);
- buildnodeflexscript(resetTrigger);
You can add markup text to the code that will appear in the On Reset field.
And \" works for me. Can't say why it doesn't for you. Can you attach the model where you tried to use it?
16 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 | © 2025 Autodesk Inc. All rights reserved