question

Gina Lasure avatar image
4 Likes"
Gina Lasure asked Matthew Gillespie edited

Is there a way to open a dashboard via code?

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?

FlexSim 16.2.0
flexscriptdashboards
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

Matthew Gillespie avatar image
8 Likes"
Matthew Gillespie answered Matthew Gillespie edited

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);
· 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.

Albert L avatar image Albert L commented ·

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 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Albert L commented ·

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

treenode newDashboard = applicationcommand("adddashboard");
1 Like 1 ·