- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Simulating and exporting nested...
Simulating and exporting nested packages with OMShell or OMPython
Simulating and exporting nested packages with OMShell or OMPython
Hi everyone,
I have a Modelica package which contains a few nested packages, which I created using xogeny’s instructions in Modelica by Example. It’s organized as a directory containing a package.mo file and many subpackages as directories.
I can load this complete package in OMEdit without issue by loading the package.mo in the « mother package » directory, and then I can simulate any nested package or export files to FMU.
However, I’m trying to make a script that would load this package and then extract any file to an FMU. I have not found any way to do it with OpenModelica.
I tried the following OMShell commands :
loadModel(Modelica);
loadFile("package.mo"); // This is the mother package file, this command works
loadFile("OneElement/package.mo"); // Doesn’t work
loadModel(Toy_Exclude.OneElement); // Toy_Exclude is the « mother package », and this command doesn’t work either
translateModelFMU("OneElement/OneElement.mo"); // Doesn’t work either, heh
In OMPython, I could not even load an OMCSession because python says there is no module named omniORB (even though I installed it using conda).
I’m using Ubuntu 14.04 LTS, with OMEdit+OMC version 1.10.0~dev-706-g510e963-1.
Did I miss something ?
Thanks in advance for your answers.
Re: Simulating and exporting nested packages with OMShell or OMPython
Did you find a fix for this?
I am also on Ubuntu 14.04 and used "apt-get install omniORB omniidl omniidl-python" to install omniORB,
but I am als getting the ImportError: No module named omniORB
On Ubuntu 16.04 everything worked as expected.
Re: Simulating and exporting nested packages with OMShell or OMPython
Maybe the dependencies are wrong, because after installing some additional packages it now works.
I had to run
Code:
sudo apt-get install omniorb python-omniorb omniidl omniidl-python
to make it work.
Not sure whether the package
Code:
omniorb-idl
is also required.
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Simulating and exporting nested...