Drawing Primitives

To dress-up a diagram or design an icon, you can create or modify graphical primitives.

Note: Icons are usually drawn in the icon layer, but the drawing commands can also be used from the diagram layer.

When defined, the origin of the primitive is displayed as a red cross when the primitive is selected.

In this scenario you first draw a rectangle and a text, then ellipses with different closure.


Before you begin: To be able to change graphical properties, the Modelica Graphics Properties dialog box must be displayed. If it is not displayed when you start drawing, do the following:
  1. From the Diagram section of the action bar, make sure that the command Modelica Graphics Properties is activated, that is, it is framed. If not, click it to activate it.
  2. To see the dialog box, you may have to:
    1. If the dialog is minimized, click, in the right part of the screen, the icon to expand it.
    2. If the dialog is docked and not pinned, click the relevant frame of the work area and pin the dialog.
See Also
Using a Grid
Displaying and Moving the Origin
Switching from Diagram Layer to Icon Layer
  1. From the Diagram section of the action bar, click Rectangle .
    The Rectangle Properties section in the Modelica Graphics Properties dialog box is expanded.
    Important: The Modelica Graphics Properties dialog box displays more or less options, depending on the profile you want to create or modify.
  2. Drag a rectangle.

    Tip: If you create a polygon, double-click to end the command and create a polygon.

    Your rectangle is created.

  3. From the Filled Shapes Properties section in the Modelica Graphics Properties dialog box, select the blue color from the Fill Color option.
  4. Define the Fill Style option as Solid.
    The rectangle is filled with blue.

  5. From the Diagram section of the action bar, click Text .
    The Text Properties section of the Modelica Graphics Properties dialog box is expanded.
  6. Drag the bounding box of the text.
    The text is created, with the text that is present in the Content box from the Text Properties section of the Modelica Graphics Properties dialog box.
  7. Change the text in the Content box to the text you want.

    Tip: To enter a new text, mark the whole text in the Content box and then type the new text.

    The text is changed.

  8. Select the font size of the text from the Font size box from the Text Properties section of the Modelica Graphics Properties dialog box.

    The default value auto means that the text font size by default adapts to the size of the bounding box.

    Important: To prevent displaying too small texts when auto font size is selected, the minimum text font size is by default set to 8 pt by the option Restrict minimum font size. You can manage this option from from Me > Preferences > App Preferences > 3D Modeling > Systems Modeling and Execution > Dymola Behavior Modeling , the Editor tab, the Text Graphical Primitives group. For more information, see Editor: Text Graphical Primitives.

  9. Draw three ellipses the following way:
    1. From the Diagram section of the action bar, click Ellipse and draw it the same way as the rectangle.
    2. From the Filled Shapes Properties section in the Modelica Graphics Properties dialog box, select from the options to get as result a solid dark line color with double line thickness and a solid light fill color.
    3. From the Ellipse Properties section, change End Angle to 300 and select Closure to None.
    4. Select the ellipse and use Ctrl+C and Ctrl+V to copy and paste it.
    5. For the new ellipse, from the Ellipse Properties section, select Closure to Chord.
    6. Copy and paste like above to create a third ellipse.
    7. For the third ellipse, from the Ellipse Properties section, select Closure to Radial.
    The result is:

  10. Minimize the Modelica Graphics Properties dialog box.
    Modelica Graphics Properties icon appears on the right side of the screen.
  11. If you need to modify:
    • One component: Select the component, the Modelica Graphics Properties dialog box appears.
    • Several components: Multiselect components, then click Modelica Graphics Properties .