- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » OMC Command to add...
OMC Command to add constants/parameters/variables
OMC Command to add constants/parameters/variables
Hello,
I am trying to use the OMC to generate Modelica code. I am very familiar with the OMC and its API. However, the only way I have found of adding a parameter under a given model or package is to use the following Command string:
"package x parameter Real a; parameter Real b; end x;"
However, this method is very problematic as it requires that all the code listing be inserted.
Is there a better way? Something like addParameter(ParentClass, parameterName)?
Thanks
C. Adourian
Re: OMC Command to add constants/parameters/variables
Hi,
use addComponent() and updateComponent().
See here:
https://trac.openmodelica.org/OpenModel … aAPI-Howto
Also in the testsuite here:
https://trac.openmodelica.org/OpenModel … active-API
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
Re: OMC Command to add constants/parameters/variables
Hi Everyone,
I have a question regarding compiling a model from cmd using OMC command. It seems like it takes more time to compile and simulate the model using OMC. I just wanted to ask if anyone knows the parameters affecting the time that it takes to compile the model. I increased the number of the elements in my model and it takes approximately the same time to be compiled. So, I was wondering what parameters of the model affect the time consumption for simulation.
Thanks for your attention,
Pouya
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » OMC Command to add...