Jump to content
gtwirth

Export Import Model Using A Text File

Recommended Posts

Here is a simple utility that will export your model to a text file (pipe delimited). Then you can modify the file and import the model back in. NOTE: Currently, this utility does not handle graphics in your model.


There is also has capabilities to import and export lists and networks.


Here are some quick instructions on how to setup this add-in.


1) Download the "ExportImportModelAddIn_DLL.zip"


2) Extract "ExportImportModelAddIn.dll" from the "ExportImportModelAddIn_DLL.zip" into a temp folder (e.g. c:\temp).


3) Right-click the assembly and select properties. Then choose to "unblock" button and press apply. (only needed for Windows 7 and later).


4) Copy "ExportImportModelAddIn.dll" into "C:\Users\\Documents\SimioUserExtensions". You might need to add the SimioUserExtensions folder under MyDocuments (C:\Users\\Documents) if it does not already exist.


5) Open Simio and load your model.


6) From the Project Home...Select Add-In button, select "Export Import Model"


7) Choose the function that you want to run (e.g. Export, Delete, Import, etc..). Note...If you export and then import the model without a delete, it will update the object data if the object already exist.


Updated 2017-12-05....Fixed index issue with links import.


Updated 2017-09-25....Fixed the import of lists.


Updated 2017-07-14....Added the ability to auto generate and auto read files. Previously, the files need to be created prior to running the add-in. Now, they will created by the export. Also, the import will retrieve the same file generated by the export. These options are available when the "Auto Generate and Read Files" option is selected.


Updated 2017-07-13....Added the ability to multi-select options. Now, more than one option can be initiated when the OK button is selected. This will streamline the process of exporting, deleting and importing. This tool is very helpful for testing out your model with various configurations to ensure that runs properly under various object and/or data configuration.

 

MultiSelectOptions.png.27a3bbf629dc09c8845c263b4711cd0b.png

 

Updated 2017-07-11....Now supports exporting and importing of model properties, exporting and importing of table properties and delete table data.


Updated 2017-06-22....Now supports exporting and importing of data tables using using XML. This is simple way to export all the table data from one model and import the same data into a new model (assuming that the same tables schema exist in the new model).


Updated 2017-01-27....Now supports exporting of object types using XML. This can be used with the new Configure Scheduling Resources in Simio 9.150 capabilities to define your own object type properties based on an XML document.


Updated 2017-01-23....Now supports exporting and importing objects using XML. When using XML, property units are also exported and imported back in.


Updated 2016-10-24....Updated files...Added support for repeating properties.

ExportImportModel_Code.zip

ExportImportModelAddIn_DLL.zip

Edited by Guest

Share this post


Link to post
Share on other sites

nice!, thank you!


this is perfect since i can interface this with a python program, edit away there and then come back and import it, amazing stuff!


similar to the excel import but plain text files are always nicer,


regards,

Share this post


Link to post
Share on other sites

hi... on another note, when exporting a file, I have to manually create the blank txt file before exporting, or is it just me_

is there a way of making the addin create the txt automatically if it doesnt exist?


thanks!


regards

Share this post


Link to post
Share on other sites

Thanks, great stuff...


Is it possible to export the files as .csv (comma seperated values) in stead of the | seperated values? This will allow easy import, edit and save in excel.

Share this post


Link to post
Share on other sites

yeah, excel lets you import this files with other delimiters, go to Data Menu, Import From Text, then next and in delimiter define"|" in "other", :D


hope this helps :)

Share this post


Link to post
Share on other sites

I have updated this add-in to support the export and import of elements.


If you need to update the properties on the elements in your model, first export them. Then update the text file and the import them again. The element properties will be updated.


See attached code and DLL...


Updated 2014-01-24....See later posts for code and DLL.

Share this post


Link to post
Share on other sites

Thanks,


One feature that I would still like is a selective delete, or a rename. Is it currently possible to rename objects?


It would be great if the functionality of this add was incorporated into the standard Simio package, allowing for a batch select.

Share this post


Link to post
Share on other sites

Hi Mark...Please clarify...Do you mean updating the LogObservation property on a StateStatistic or TallyStatistic elements?


This can be done with the existing Export Import Model Add in...


I was able to export the elements from the HositalEmergenyDepartment.spfx. Then, I ran a a search an replace From "LogObservations|False" to "LogObservations|True". Imported the elements file. Once this is done, all StateStatistics and TallyStatistics in the model were being logged.

Share this post


Link to post
Share on other sites

I have updated this add-in to support the export and import of vertices.


If you need to update the vertices on a link in your model, first export them. Then update the text file and the import them again. If the link exists in the file, all vertices on a link will be removed and then re-added based on what is contained in the file.


See attached code and DLL.


Added 2014-03-04....The ability to define your own delimiter...Note: Import and Export of Objects does not work well with the comma as the delimiter. The expression properties will not import correctly since expression typically have commas in them as well.


Added 2016-01-27....Updated project to use Microsoft .NET 4.5 Framework.


Update 2016-10-24....See first post for latest files.

Share this post


Link to post
Share on other sites

Hi Glen,


This was my bad...I had exported all output statistics, changed to state statistics, and re imported....Had to do this again for state statistics to reset log observations to true as the default was false.


Forgot the output statistics does not have the log observations property.

Mark

Share this post


Link to post
Share on other sites

Hi!


Im having a little problem with the add in. In Simio, under select add-in, I do not have the "Export Import Model"option. All I have is the "Place Source, Server, Sink" option. I created the folder just the way you said "C:\Users\\Documents\SimioUserExtensions", does ir have anything to do with the version 9.147?

Share this post


Link to post
Share on other sites

×