gtwirth Posted July 12, 2013 Share Posted July 12, 2013 Here is a simple utility that will export, import and delete artifacts of your model. Here is a screen shot of the available capabilities. The code and DLL have can be found on SImio GitHub. Please find at this link: https://github.com/SimioLLC/ExportImportModelAddIn You will also find install instructions in the ReadMe. Here are the changes that have happend over time: Updated 2023-01-31....Added the ability to select multiple tables for export and delete table data functions. Updated 2022-10-05....Updated the exports to sort the data first my name and then export. This ensures that the data exported is in a consistent order. Updated 2021-12-07....Added the ability to select a table and then remove the data from the selected table. If a table name is not selected, all the tables in the model will have their data removed. Updated 2021-09-20....Added Update Model Properties (CSV). With this new method, you can import model properties into your model. If the file contains 3 fields...First is name, then type and last is default value. The only valid types are real, datetime, Boolean and everything else is string. If the model property already exists, it will only update the default value on the property. Note: The example assumes the field separator is a caret '^'. To change this, you need to change the delimiter field. Updated 2021-09-08....Updated the sequence of the exports, deletes and imports happen. When OK is pressed, first the exports are run, then deletes and finally the imports. With this change, I am able to Export Table to DB, Delete Table Data and Import Table from DB from in a single run. I typically do this when re-mapping auto creates elements. Since the table data need to be removed and recreated before mapping of the elements are correctly mapped. Updated 2021-09-06....Upgraded to .NET 4.7.2. Also, fixed the windows form so it displays correctly. When opened, the form should no longer need to be expanded to see all the options. Updated 2018-11-08....Added Export To CSV, Export To DB and Import From DB. Export To DB will create a table in the SQL Server database with the same table name as the table in Simio. The data columns will be of type nvarchar(max) and the default value will be the same as the default value in the Simio table. It is assumed that Simio desktop will still do the data validation, not the database. This feature is used to save the Simio data into a database so it is backed up and can be shared across users. Each time the Export To DB, if the table already exists, it is dropped, and a new table is created. This ensures that the data schemas match between the Simio model and the SQL Server database. 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 needed to be created prior to running the add-in. Now, they will create 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. 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 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 exists 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. 1 Link to comment Share on other sites More sharing options...
miguelgaitan Posted July 16, 2013 Share Posted July 16, 2013 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, Link to comment Share on other sites More sharing options...
miguelgaitan Posted July 17, 2013 Share Posted July 17, 2013 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 Link to comment Share on other sites More sharing options...
willem Posted July 17, 2013 Share Posted July 17, 2013 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. Link to comment Share on other sites More sharing options...
miguelgaitan Posted July 17, 2013 Share Posted July 17, 2013 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", hope this helps Link to comment Share on other sites More sharing options...
gtwirth Posted September 12, 2013 Author Share Posted September 12, 2013 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. Link to comment Share on other sites More sharing options...
MEagar Posted September 13, 2013 Share Posted September 13, 2013 Glen, If I had a sheet of golden stars, I would stick on on your forehead... THANK YOU SO MUCH !! Mark Link to comment Share on other sites More sharing options...
MEagar Posted September 13, 2013 Share Posted September 13, 2013 Glen, Can you please extend this for functions as well.... Link to comment Share on other sites More sharing options...
willem Posted September 13, 2013 Share Posted September 13, 2013 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. Link to comment Share on other sites More sharing options...
MEagar Posted January 24, 2014 Share Posted January 24, 2014 Hi Glen... PLEASE can you update the export to include Log_Observations == True/False.... Fanks !! Link to comment Share on other sites More sharing options...
gtwirth Posted January 24, 2014 Author Share Posted January 24, 2014 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. Link to comment Share on other sites More sharing options...
gtwirth Posted January 24, 2014 Author Share Posted January 24, 2014 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. Link to comment Share on other sites More sharing options...
MEagar Posted January 27, 2014 Share Posted January 27, 2014 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 Link to comment Share on other sites More sharing options...
MEagar Posted September 21, 2015 Share Posted September 21, 2015 Could we possibly include user defined properties within this worksheet ?? Link to comment Share on other sites More sharing options...
gtwirth Posted September 21, 2015 Author Share Posted September 21, 2015 Hi Mark, Are you referencing the Spreadsheet Import? http://www.simio.com/forums/viewtopic.php?f=36&t=904 If so, you should be able to add the column to the spreadsheet that references the user defined property. The spreadsheet import should see and import the values defined in the column of the spreadsheet for the object. Link to comment Share on other sites More sharing options...
MEagar Posted September 22, 2015 Share Posted September 22, 2015 Hi Glen, Speaking about these properties. Link to comment Share on other sites More sharing options...
DaniAzGo1 Posted September 17, 2017 Share Posted September 17, 2017 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? Link to comment Share on other sites More sharing options...
jaylee0300 Posted September 16, 2018 Share Posted September 16, 2018 Thank you .. this is amazing stuff. By the way, is it possible to import and export Process step as well? 2 Link to comment Share on other sites More sharing options...
gtwirth Posted November 8, 2018 Author Share Posted November 8, 2018 Process steps cannot be exported....New capabilities just added...See first post on this topic. Link to comment Share on other sites More sharing options...
jzhou Posted November 8, 2018 Share Posted November 8, 2018 finally I can use the addIn, it's kool stuff.thanks Glen. Link to comment Share on other sites More sharing options...
willem Posted January 10, 2020 Share Posted January 10, 2020 On 11/8/2018 at 3:58 PM, gtwirth said: Process steps cannot be exported....New capabilities just added...See first post on this topic. Hi Glen, Would it at all be possible now or in future to import and export processes? We have 8 models that have to use the same processes but have different data tables and layouts. Most of the logic we can place objects but not all, so we have some logic in the main model. Any suggestions on how to do this other than a manual copy paste? Regards, Willem Link to comment Share on other sites More sharing options...
teresimio123 Posted February 17, 2020 Share Posted February 17, 2020 Hi Willem! I wanted to know if you found out how to create the 8 models that have to use the same processes but have different data tables and layouts (not manually). Thank you!! Tere Link to comment Share on other sites More sharing options...
willem Posted February 18, 2020 Share Posted February 18, 2020 Hi Tere, We still largely used the manual approach, however we used a lot of subclassed object to make sure a change gets applied to all 8 models. We also made use of the table based autocreate to create the different layouts. We do have 8 separate models and we just copy paste the processes. Essentially we could have had one model but with 8 different sets of bindings, this was also not ideal as we have multiple table and even just selecting all of the different bindings while testing would have been cumbersome. If you find a better way please let us know. Regards, Willem Link to comment Share on other sites More sharing options...
galeota Posted June 10, 2020 Share Posted June 10, 2020 Hi Glen, I need your support for an error that I have to manage very often. My company set an automatic backup on One Drive and that is creating problem to load your Add-In. The body of the error is the following: Exception in loading types from 'C:\Users\username\OneDrive \documents\.\SimioUserExtensions\ExportImportModelAddIn.dll', message: 'Could not load file or assembly 'file:///C:\Users\username\OneDrive\documents\SimioUserExtensions\ExportImportModelAddIn.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)' Loading 'C:\Users\username\OneDrive\documents\.\SimioUserExtensions\ExportImportModelAddIn.dll' may have failed because the DLL was copied from another computer and has been blocked by Windows. To unblock it, copy the file to a user writable directory, right click on it and select Properties, on the General tab, click Unblock, then click OK, and then copy it back to your UserExtensions folder if necessary. Off course the file is unblocked, do you have some suggestion to fix it? Simio version is 11.197.19514.0 1 Link to comment Share on other sites More sharing options...
willem Posted October 5, 2021 Share Posted October 5, 2021 Import export input parameters please. Link to comment Share on other sites More sharing options...
Recommended Posts