- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Modelling from command line or Python
Modelling from command line or Python
Modelling from command line or Python
Hi. I am a beginner at Modelica and was wondering if it is possible to model from the command line (or alternatively from python using the OMPython package). What I mean is: in OMEdit I can set up a model by dragging for instance a ground and a resistor on to the screen and then connect the two with a line. I am wondering if it is possible to set this up from the command line some how. Maybe my sudo code below will clarify.
I am firstly wondering if this is possible, and secondly how to do this.
Sudo code:
>>> load(Modelica)
>>> import(some_path + '/Electrical/Analog/Basic/Ground.mo', name='ground1')
>>> import(some_path + '/Electrical/Analog/Basic/Resistor.mo', name='resistor1')
>>> connect(ground.p, resistor1.p)
Any answer is much appreciated.
Thanks!
Re: Modelling from command line or Python
You can look into OMEdit's logs to see which commands it uses. Some of these commands work out of the box in OMPython, some need to be called with parsed=False as far as I remember.
- sjoelund.se
- 1700 Posts
Re: Modelling from command line or Python
Tools -> OMC CLI for accessing in the GUI
Or look for logs in your tmp-directory (on Linux: /tmp/OpenModelica_$USER/OMEdit/)
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Modelling from command line or Python