Exchanging a Component Class

You can exchange the class of a top-level component.

Note: This task only describes exchanging a component class to another one, without any features. If you want to work with changing components to classes that fulfil certain criteria, see Working with Replaceable Components.

See Also
Editing Class Attributes
About Modelica Components
  1. Right-click the component and select Change Class > Replace Class .

    Tips: You can also perform this command by doing any of the following:
    • Right-click, in the Component Browser, the component you want to replace the class of and select Change Class > Replace Class .
    • From any browser containing classes, for example, the main Package Browser, drag the class you want to use for replacing to the Component Browser and drop it on top of the component you want to replace the class of.
      Notes:
      • When you have done this, a dialog box may appear where you must select Change class of component to complete the action.
      • The result of this step and Step 2 below does not apply when using this alternative since you already selected the class by dragging it.
      • For more information about this alternative, see Dragging a Model, Block, Type, or Record to the Component Browser.

    Notes:
    • You can only exchange class of one component at a time, multiselecting a number of components and applying the command only works on the first selected component.
    • The command Change Class > Matching Choices can only be used for replaceable components. See Working with Replaceable Components.

    The Replace Class dialog box appears, with the Component Class box selected.
  2. Select another class from the Package Browser.

    Tip: You can select the class in a number of ways, including searching for it; see Select a Class with the Class Selector Box.

  3. Click OK to close the Replace Class dialog box.
    A message informs you if any connections are broken or if modifiers must be removed when exchanging the component class.
  4. If connections are broken, you can select from the following alternatives:
    • Click Yes to open the Connection Manager to repair the broken connections after replacement of the class.

      For more information about the Connection Manager, see Using the Connection Manager.

    • Click No to acknowledge that the connections will be broken.
    The class is exchanged in the diagram layer. The Connection Manager may appear depening on previous selection.
    Note: The component name is not changed.
  5. Optional: To change the name of the component, do the following:
    1. Right-click the component and select Edit Component Parameters.
    2. Change the name.
    3. Click OK to validate your modification.