You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in OMEdit, I can create a blank model/class, then drag and drop blocks/components, and make connections between them, incrementally building a model. Can I use OMPython to similarly incrementally build a model from scratch by adding blocks/components and connections? something like
from OMPython import OMCSessionZMQ
omc = OMCSessionZMQ()
cmds = [
"newModel(getInstallationDirectoryPath() + "/share/doc/omc/testmodels/MyModel.mo")",
"addComponent(Modelica.Electrical.Analog.Basic.Resistor "R")",
"addComponent(Modelica.Electrical.Analog.Basic.Ground"gnd")",
"addConnection(R.n gnd.p)",
... until the model is complete
"translateModelFMU(MyModel)",
"simulate(MyModel)",
etc.
]
for cmd in cmds:
answer = omc.sendExpression(cmd)
print("\n{}:\n{}".format(cmd, answer))
in OMEdit, I can create a blank model/class, then drag and drop blocks/components, and make connections between them, incrementally building a model. Can I use OMPython to similarly incrementally build a model from scratch by adding blocks/components and connections? something like
i've read through
and nothing seemed to be obviously related to what i want to do.
using help(OMPython) i found this, is that related to what i want to do?
The text was updated successfully, but these errors were encountered: