Is there a way to open a dashboard via code?

Is there a way to open a dashboard via code?

gina_lasure1
Not applicable
422 Views
3 Replies
Message 1 of 4

Is there a way to open a dashboard via code?

gina_lasure1
Not applicable

[ FlexSim 16.2.0 ]

Opening a GUI is very simple with the "createview" command combined with the GUI's path in the tree - but I cannot convince a dashboard to open correctly with the same command. Has anyone done this successfully?

Accepted solutions (1)
423 Views
3 Replies
Replies (3)
Message 2 of 4

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

You need to use the "dashboard" application command, for example this opens the first dashboard in your model:

applicationcommand("dashboard", Model.find("Tools/Dashboards").first);


Matthew Gillespie
FlexSim Software Developer

Message 3 of 4

albert_l
Not applicable

Hi Matthew, when I ran this code, the dashboard window opened but the dashboard didn't appear in the ToolBox list which lists out things like: All user commands, all global tables, all groups, all dashboards. Is there a way to create the dashboard and reference it afterwards in order to: change the dashboard name, add charts and graphs? Thank you.

0 Likes
Message 4 of 4

Matthew_Gillespie
Autodesk
Autodesk

That command doesn't add a new dashboard. To add a new dashboard use this command:

treenode newDashboard = applicationcommand("adddashboard");


Matthew Gillespie
FlexSim Software Developer