OMPython
OMPython copied to clipboard
ModelicaSystem without file input, load from standard library
I would like to have a way to load a model from MSL or an other library in your Modelica library path with ModelicaSystem
.
Apparently some new users are struggling with this, see this question on StackOverflow.
The only solution I could found to load an example from MSL was to search for the path of my MSL libnrary and use
mod = ModelicaSystem('/path/to/lib/omlibrary/Modelica 3.2.3/package.mo', 'Modelica.Electrical.Machines.Examples.AsynchronousInductionMachines.AIMC_Inverter')
If I called omc.sendExpression('loadModel(Modelica, {"3.2.3"})')
or omc.sendExpression('loadFile("/path/to/lib/omlibrary/Modelica 3.2.3/package.mo")')
before I would like to just use:
mod = ModelicaSystem('Modelica.Electrical.Machines.Examples.AsynchronousInductionMachines.AIMC_Inverter')