OpenModelica / OMPython

A Python interface to OpenModelica communicating via CORBA or ZeroMQ
Other
98 stars 57 forks source link

OMPython

OMPython is a Python interface that uses ZeroMQ or CORBA (omniORB) to communicate with OpenModelica.

FMITest Test

Dependencies

Using ZeroMQ

Using omniORB

Installation

Installation using pip is recommended.

Linux

Install the latest OMPython master by running:

python -m pip install -U https://github.com/OpenModelica/OMPython/archive/master.zip

Windows

Install the version packed with your OpenModelica installation by running:

cd %OPENMODELICAHOME%\share\omc\scripts\PythonInterface
python -m pip install -U .

Local installation

To Install the latest version of the OMPython master branch only, previously cloned into <OMPythonPath>, run:

cd <OMPythonPath>
python -m pip install -U .

Usage

Running the following commands should get you started

import OMPython
help(OMPython)
from OMPython import OMCSessionZMQ
omc = OMCSessionZMQ()
omc.sendExpression("getVersion()")

or read the OMPython documentation online.

Bug Reports

Contact