Search code examples
modelicadymola

Assign specific connection style to connector in Modelica


In Modelica, it is possible to define annotations attached to an object, such as a connector, that change their graphical appearance.

Is it possible to also define how the connection from one connector to the other will look like? Such as two instances of the connector class "foo" will always have a dashed line as a connection, while two of the class "bar" will have a thicker full line.

So far, I noticed that the connections lines take the color of the outside stroke color of the connector, but that's it. And I did not find anything in the documentation related to this.


Solution

  • Yes, it is possible:

    If you take a look at Modelica.Blocks.Examples.BusUsage_Utilities.ControlBus you will se that extends from an icon (Modelica.Icons.SignalBus) and places a small yellow rectangle on top of the icon:

    Icon with rectangle

    If you modify the rectangle specification in the annotation of the connector the visible lines between the connectors will be displayed with the rectangle style, e.g.

    changing connection appearance via annotation

    The connected ControlBusses look like this: Connection between ControlBusses

    On the information layer of Modelica.Blocks.Examples.BusUsage there are a few remarks on the subject.

    Best regards, Rene Just Nielsen