OpenModelica / OMPython

A Python interface to OpenModelica communicating via CORBA or ZeroMQ
Other
107 stars 58 forks source link

Custom Build Directory #204

Closed kiroorooki closed 7 months ago

kiroorooki commented 7 months ago

Hey, I need to build my model in a specific folder for my program.

I have no clue if this functionality already exists but I've modified OMPython for my purpose.

Can someone tell me if there's a proper way and if there isn't, can we add this functionality to OMPython? Many thanks!

Modification: -Added "customBuildDirectory=None" as an argument for ModelicaSystem

-Added the following ModelicaSystem init:

if customBuildDirectory is not None:
    exp="".join(["cd(","\"",customBuildDirectory,"\"",")"])
    self.getconn.sendExpression(exp)
arun3688 commented 7 months ago

@kiroorooki the issue is fixed with this commit https://github.com/OpenModelica/OMPython/commit/bdd04a37ee99a9c110b5df87b771fa1f7d0205ca, please update your pip package with the following command

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