question

Tomi Kosunen avatar image
0 Likes"
Tomi Kosunen asked Tomi Kosunen commented

Node value syntax

Hi. I can't find the FlexScript syntax to get the statistics value out from the model. I have:

ElevatorBank bank = a.as(ElevatorBank);

treenode B_Elev = bank.elevators[1];

treenode stat_node = B_Elev.find(">stats/state_profiles/Elevator/profile");

How do I get the (for example) "opening door" out from the table?



1632138351081.png



FlexSim 21.2.0
node command
1632138351081.png (46.1 KiB)
5 |100000

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

Phil BoBo avatar image
1 Like"
Phil BoBo answered Phil BoBo edited

The Elevator node in your image is a TrackedVariable node. You can access its data and the data in the profile node using the TrackedVariable FlexScript API.

ElevatorBank bank = a.as(ElevatorBank);
Object B_Elev = bank.elevators[1];
TrackedVariable tv = B_Elev.stats.state("Elevator");
return tv.getCategoryName(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.

Lars Christian J2 avatar image
0 Likes"
Lars Christian J2 answered Tomi Kosunen commented

Or you can access the data as a bundle table

1632200668489.png



1632200668489.png (5.8 KiB)
· 1
5 |100000

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

Tomi Kosunen avatar image Tomi Kosunen commented ·
Even better for me. Thanks!
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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