returning values from dashboard data table

returning values from dashboard data table

niphon_jeepjua
Explorer Explorer
9 Views
2 Replies
Message 1 of 3

returning values from dashboard data table

niphon_jeepjua
Explorer
Explorer

[ FlexSim 20.2.3 ]

Hello ,

just a quick question: I would like to read values from a milestone dashboard by code (see picture attached):

on the left- hand side, there are the tree objects that refer to the dashboard on the right- hand side. I would like to read / return the dashboard´s value which are represented in the middle (see script at the bottom). DataType of the model object is DATATYPE_BUNDLE = 6. How could I access one of the array values in the line “0[204.852819, 222.192612]” by code?


1659006435256.png

0 Likes
Accepted solutions (1)
10 Views
2 Replies
Replies (2)
Message 2 of 3

moehlmann_fe
Observer
Observer
Accepted solution

Once you have a reference to the bundle node ("data", in your case) you can either cast the node as a table and use the normal table syntax. Or you can use the command 'getbundlevalue()' to read the data directly from the node.

Note that the entry (row) and field (column) indexes start at 0 in the second case.

treenode bundleNode = Model.find("...");

// Access as Table
Table bundleTable = bundleNode;
return bundleTable[1][3];

// Read directly from bundle node
return getbundlevalue(bundleNode, 0, 2);

If you type "bundle" into the command helper, you can find many more commands to directly edit bundles.

1659007367519.png

Message 3 of 3

niphon_jeepjua
Explorer
Explorer
Thanks @Felix Möhlmann , I like the idea casting the node as a table, since I am more familiar with these.
0 Likes