question

Nip J avatar image
0 Likes"
Nip J asked Nip J commented

returning values from dashboard data table

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

FlexSim 20.2.3
dashboard data
1659006435256.png (153.2 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.

1 Answer

·
Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Nip J commented

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


1659007367519.png (14.1 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.

Nip J avatar image Nip J commented ·
Thanks @Felix Möhlmann , I like the idea casting the node as a table, since I am more familiar with these.
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.