I would like to export the following data to excel (see screenshot). Can you walk me through it with screenshots? I tried to follow a thread from 2017 and 2021 but couldn't get it working. Thanks for the help.performance_measure_export.PNG
I would like to export the following data to excel (see screenshot). Can you walk me through it with screenshots? I tried to follow a thread from 2017 and 2021 but couldn't get it working. Thanks for the help.performance_measure_export.PNG
Hi @tr-simulation, was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.
If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.
Load this user library to imprint a command called exportPFM in your model.
Then use it like this:
exportPFM("NumScans");
ExportPFM() user command:
/**Custom Code*/ string pfmname=param(1); string workbookname=param(2); if (workbookname==""){ workbookname=currentfile; workbookname=workbookname.slice(1,workbookname.length-3)+"_pfms.xlsx"; } Database.Connection db = function_s(Model.find("Tools/Experimenter"), "getDBConnection"); int disconnect = 0; if (!db.isConnected) { if (!db.connect()) { return 0; } disconnect = 1; } // Query for ID of best iteration Database.ResultSet resultset= db.query("SELECT d.name AS Scenario, c.replication AS Replication, a.value AS "+pfmname+" FROM pfm_values a INNER JOIN pfms b, tasks c, scenarios d ON a.pfm_id=b.id AND c.id=a.task_id AND d.id=c.scenario_id WHERE b.name='"+pfmname+"' ORDER BY Scenario ASC, Replication ASC"); treenode tempnode=nodeinsertinto(Model.find("Tools").subnodes.assert("temp")); resultset.cloneTo(tempnode); Table temptable=Table(tempnode); // Create new Excel workbook excelcreateworkbook(); excelcreatesheet("PFMs"); excelsetsheet("PFMs"); excelexporttable(temptable,2,1,temptable.numRows,temptable.numCols); for (int n=temptable.numCols;n>0;n--) excelwrite(temptable.getColHeader(n),1,n); excelsave(workbookname); excelclose(0); tempnode.destroy(); if(disconnect) { db.disconnect(); }
Another option I found was to go to experimenter > advanced tab > add a trigger using the green plus sign > select "at end of job" > export to CSV. For me this saved automatically to my downloads.
For those finding this post and wondering what the difference is, the CSV standard output looks like this which is very useful as a report:
While the code in the answer above generates this which can be easier to process using queries.
14 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved