Search code examples
modelicadymola

How to redeclare the annotation when inheriting a component in Modelica language?


I want to modify the annotation part when inheriting a component in Dymola, but I am not sure if Modelica supports this kind of manipulation.

My question is :

  1. Does Modelica allow this kind of manipulation?
  2. How should I modify the appearance if I can't modify the annotation part when inheriting a component?

Solution

  • If you want to 'redraw' the icon of a model extending from another model you can use the following annotation

    model ExtendedModel
      extends BaseModel annotation (
          IconMap(
            extent={{-100,-100},{100,100}}, 
            primitivesVisible=false), 
          DiagramMap(
            extent={{-100,-100},{100,100}}, 
            primitivesVisible=true));
    
      end ExtendedModel;