Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

OMC API updateComponent problems with arrays

OMC API updateComponent problems with arrays

Hello everyone,

I am currently using the OMC API to set custom annotation to components. (See this post) It works fine for simple components, but when I try to modify the annotation of an array, the array dimensions disappear.

I have a parameter defined by

        parameter Real v[3] = {0,1,2};

Here is a simplified version of the command I'm using :

        updateComponent(v,Real,Test,annotate=__MyTag(name="<String>"))

and when I save the model the parameter is now defined by

         parameter Real v = {0, 1, 2} annotation(__MyTag(name="<String>"));


Do you have any idea how to either change the annotation without stripping the component of it's dimensions or to add the dimensions back ?

Thanks a lot,

Alexandre

Re: OMC API updateComponent problems with arrays

What version of OM do you use? From what I can see this was fixed in r15501, almost two years ago.

Re: OMC API updateComponent problems with arrays

I am using 1.8.0 but I tried 1.9.1 and it doesn't seem to have helped.

Re: OMC API updateComponent problems with arrays

This is working fine with r23646.

For example try this

Adeel.

Re: OMC API updateComponent problems with arrays

Thank you ! It works. I don't know what I've been doing wrong but at least now I know how I should have been doing it.

Have a nice day,

Alexandre

There are 0 guests and 0 other users also viewing this topic
You are here: