question

Christopher H4 avatar image
0 Likes"
Christopher H4 asked Christopher H4 edited

Create and assign values to child labels via flexscript

I'm currently creating a model in which I want to record some simulation results as label data. However, to distinguish between model setup labels and results data labels I wanted to create a label called "results" and then assign nodes within "results" to the different values.

Is there some way to do this, preferably via coding (Flexscript or C++)?

FlexSim 20.2.3
labelsflexsim 20.2.3
1620059784057.png (13.1 KiB)
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Christopher H4 avatar image
0 Likes"
Christopher H4 answered Christopher H4 edited

I managed to figure out this issue on my own.

If anyone has this same issue the following is the code I used.

Model.find("TaskExecuter").labels.assert("results");

Model.find("TaskExecuter").labels["results"].subnodes.assert(sig_out_channel);

Model.find("TaskExecuter").labels["results"].subnodes[sig_out_channel].value = Result_Data;


The trick was having to have subnodes predefined as nodes with subnodes cannot be dynamically created and allocated as normal nodes can.


1621026500423.png (12.7 KiB)
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered

You can use tables or arrays as labels.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.