- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Scripting API to close a model
Scripting API to close a model
Scripting API to close a model
I'd like to develop a python script that needs to do:
1) Load a *.mo file
2) Extract the parameter settings in the model and save it in an external file
3) Close the model and exit
This script should process lots of *.mo files in different folders.
For 1), I figured out to do that by using ModelicaSystem(...) API. After calling this API, OpenModelica generated lots of intermediate files. I am wondering how to do the step 3), meaning close the model and remove all these intermediate files automatically.
Any suggestion would be much appreciated.
Thanks.
Kai
Re: Scripting API to close a model
tjroamer wrote:
After calling this API, OpenModelica generated lots of intermediate files
After initiating
Code:
ModelicaSystem
the model will be build at the current working directory and as a results you got the executable and xml to run the simulation. As far as i know, there are no option to to delete the intermediate files automatically.
At top of my head, you can make a subclasss of
Code:
ModelicaSystem
and add a routine to delete the c-files.
- Arinomo23
- 120 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Scripting API to close a model