Composing Models

You can create instances of Modelica classes in a target model from the diagram view and connect these instances. If your assessment template is from a study template that is a copy of the Modelica model, you have more options. You can move these instances and connections to adjust the diagram layout.


Before you begin: Create an assessment template. For more information, see Managing Assessment Templates.
See Also
Search a Class
Composition Mode Shortcut Menus
About Assessment Specifications
  1. From the Design section of the action bar, click Composition Mode .
    The tree displays the Modelica Packages Browser.
  2. To add a Modelica library to the browser, drop the library from 3DSearch into the browser.

    Tip: You can click in the class browser to search the libraries.
    Important: Make sure to have the roles required for the libraries and models that you use. If you add a role during work, you must stop the session and start a new session, to display the components correctly.

  3. To add a component to the diagram, drop it from the browser into the work area.
    The class appears as a component instance in the diagram, with a green triangle to the upper left of the instance, to indicate that it is an added instance.
    Note: If you work with an assessment template that is from a study template that is a copy of the Modelica model the green triangle does not appear, since in this case all instances can be seen as added.
    Important: If you add FMUs or SSPs, all such items in a model must be consistent, otherwise the model cannot be simulated. For more information, see About Simulation.
  4. To resize an editable component:
    1. Select the component.

      The editable component is now surrounded by a green square and eight resize handles.

      Important: The components that you cannot move or edit are surrounded by a red square when you hover over them. Similarly, the rest of the components are surrounded by a blue square.

      Note: If your assessment template is from a study template that is a copy of the Modelica model, you can also edit components from the model.

    2. Do any of the following:

      • To resize the component horizontally, drag a handle in the middle of the left or right side.
      • To resize the component vertically, drag a handle in the middle of the top or bottom side.
      • To resize the component both horizontally and vertically, drag a corner handle.
      Notes:
      • To keep the ratio of the editable component, press and hold Shift while resizing the editable component.
      • Some component classes require a specific ratio. Therefore, the ratio of these components remains unchanged even if Shift is not pressed. You can click Properties to see if a component keeps its ratio.

  5. To create a connection:
    1. Pause over the connector to display the connector name and to know that you start a connection line.
    2. Drag from the connector and drop on another connector.

      Tip: You can pause over the connector before dropping to display what connector you connect to.

    Notes:
    • If any of the connectors represent stacked connectors, or structured connectors, an Advanced Connection dialog box appears, with one pane for each connector representation. In that case:
      1. In the left pane, select a connector. You may have to expand a tree to find it.
      2. In the pane to the right, do the same.
      3. Click OK to validate and connect.
      4. To connect, for example, several subconnectors in a stacked connector, you must repeat the above steps.
    • If any of the connectors represent an array connector, an Advanced Connection dialog box with options to select indexes. In that case:
      1. For each displayed connections, select index.
      2. Click OK to validate and connect.
      3. To connect several subconnectors in the array, you must repeat the above steps.
    • If a component contains an array of connectors, stacked connectors, or structured connectors, you can drag or drop a connection line from/to the inside of the component, to get the Advanced Connection dialog box.
      Note: The component must have a background color for this to work.
    • Expandable connectors cannot be handled.

  6. To move an editable component in the work area, drop it to the desired location.

    Tip: You can rotate or flip the editable components. The connections are automatically updated according to the changed layout.

  7. To manipulate an editable connection line, select it and drag any of its corner points to another location.

    Important: The connection lines that cannot be manipulated are marked red when you hover over them. Similarly, the rest of the connection lines are marked blue.

    Note: If your assessment template is from a study template that is a copy of the Modelica model, you can also manipulate connection lines from the model.

    Notes:
    • To get a new corner point on the connection line to work with, drag the component or any present connection point so a new corner is created.
    • To remove an excessive corner, drag the corner point or the component in such a way that the corner disappears.
      Note: The corner point may still be present. You can select the connection to see the corner points.

  8. To delete an editable component or connection, select it, and then do any of:

    Tip: You can multiselect components by keeping Ctrl pressed when you select the components.

    • Press Delete.
    • Right-click and select Delete.