Hello,
Can I export a data table automatically every 2 days of the simulation (for example) to obtain an Excel file (or CSV) for each exportation during 10 days, i.e. 5 Excels files o 5 sheets in an excel file?
Thank you
Hello,
Can I export a data table automatically every 2 days of the simulation (for example) to obtain an Excel file (or CSV) for each exportation during 10 days, i.e. 5 Excels files o 5 sheets in an excel file?
Thank you
This is a little unorthodox, but I think it's still possible. I used Process Flow to create a token every 1 second. The token is assigned a "ModelTime" label, which is just the time in the model (used later to name exported CSV files). The Custom Code activity in the Process Flow takes the data from the WIP By Type table and clones it to GlobalTable1 (you could do any chart type as long as you have a Stats Collector/Calculated Table for it).
The exported files are saved with labels that are created by concatenation so that you can figure out which CSV file is associated with each second in the model.
Hopefully this helps. You can always modify it to meet your needs.
But I have to transform the Dashboard to a Calculated Table. And a ProcessFlow associated to this calculatedTable is created. But then, it will reach the maximum size of the model. Do you know how could I fix this? How can I delete the ProcessFlow and keep the table changed?
@Jouky D, this sounds like a new question. Try posting this on answers and you will get more people to look at it.
Hi @Jouky D,
You might try something like this:
excelcreateworkbook(); excelsetsheet("Sheet1"); excelexporttable("Table1",1,1,5,3); excelsave("NewWorkBook.xlsx"); excelclose(0);
Here is some documentation on these commands:
Hello, thank you for this information. But how do I call in this Code a Dashboard table for each sheet (i.e: the first unit of time is the first sheet, second unit of time the second sheet, etc.)? And a new excel document for another dashboard? Can we do a loop to obtain a sheet for each unit of time executed and to obtain an excel workbook for each Dashboard table? And the most important question: how do I call a Dashboard table when the length of this could change, so in excelexporttable I cannot put a numrows?
Thank you for your time.
You can put this code in a user Event like ben mentioned, or you could create a inter arrival source in process flow, and add a code block. If you do either of those things, you will not need a loop.
You will have to programatically determine the number that you are looking for. Our documentation has ways of determining the number of rows and columns in a table. https://docs.flexsim.com/en/20.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Table.html
Thanks for that! But how can I call a dashboard WIP table in the Code? Is not the same as calling a Global Table.
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