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);
It's good your suggestion, however, It would be here for the user:
Is there a way to do it? If not, I will accept your answer.
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?
Don't worry! I can't attach de model:(
However, does in your model show the trigger event On Reset on:
When I use your code, it does not change On Reset box (but it executes the code On Reset). Is there a way to do it? It could be useful if the user has to change that code.
Thank you!:D
And when I call current[row]['Column1'] it returns an error because I use ' ' instead of " ". How do you use " " inside a code written inside another " "? I tried to put \", ' " ', / "... I thought \" would work as other posts said that, but, when I apply the code, it returns:
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 | © Autodesk Inc. All rights reserved