There is a user command I use in my model that exports all of my dashboard charts as csv data so I can manipulate them in an outside program. I've realized the dashboard has to be open to actually record anything. Also, if I leave it as the active tab while the model runs, it runs slower - so typically I try to have it open but not have it active while it runs. However, if I don't remember to click onto the dashboard tab before I export, the data in the export is incomplete. For one off runs this is inconvenient but workable for now, but it seems to really cause problems if I want to run my model as an experiment since the dashboard data is not captured properly even when I select "Save dashboard data for each replication".
So I'm curious if there is a better way to do the export so I don't have to rely on remembering to refresh the dashboard tab before I export and how I can make this work with the experimenter?
Here is a sample of the user command:
//=====================================================// //============= Create the Results Folder =============// //=====================================================// string strFolder = concat(modeldir(),strModelID); //Sets "strFolder" = the directory the model is in + the name for the new folder. applicationcommand("createdirectory",strFolder); //Creates a folder with the new name assigned in the previous line string strmytable; string strmycsv; string strfilename; treenode tnMyDashboard; //---------------------------------------------------// //------ Custom code to export dashboard data -------// //---------------------------------------------------// // ++++++++++++++++++ Output Dashboard ++++++++++++++++++ // tnMyDashboard = node("Tools/Dashboards/StatsDashboard", model()); strmycsv = "\\InboundCST.csv"; strfilename = concat(strFolder, strmycsv); //name for csv to export to function_s(node("Tools/Statistics/Inbound CST Shipments", model()), "createCSV",strfilename); //exporting dashboard data (same thing as right click on dashboard object and select export as csv)