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

Overwrite an icon

Overwrite an icon

Hello,
How can I change/overwrite an icon when extending a model with an existing icon.
For example the icon of model A is "A". Model B extends model A and should have the icon "B". The code below will logically put one on top of the other.
Is there a way to inhibit the inheritance of the icon, or to overwrite it? (instead of adding a white rectangle to "cover" the old icon)

Code:

  model A

    parameter Real a = 1;
    parameter Real b = 2;
    Real c;
  equation
    c = a + b;
    annotation(Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2}), graphics = {Text(extent = {{-50,-40},{50,40}}, textString = "A")}));
  end A;
  model B
    extends A(a = d);
    parameter Real d = 3;
    annotation(Icon(coordinateSystem(extent = {{-100,-100},{100,100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2,2}), graphics = {Text(extent = {{-50,-40},{50,40}}, textString = "B")}));
  end B;

Thanks!

There are 0 guests and 0 other users also viewing this topic