Extending a Model Example into a New Library

You can extend a model to be able to add components to the resulting extended model, without modifying the original model. This allows you to change that original model and have the changes automatically implemented in any model extending from this original.

Note: It is now possible to also change the resulting extended model. See the last note below.

Context: In this scenario, you create a new library containing an extended model. You extend the model example Coupled Clutches with a new name MyCoupledClutches. This new model is used in other scenarios.

  1. Create a Modelica library. For more information, see Create a Modelica Library. Give the library the name MyExtendedModelExamplesLib.
  2. Open the model example Coupled Clutches. For more information, see Accessing Model Examples.
  3. From the Package Browser, extend this model to the MyExtendedModelExamplesLib:
    1. Right-click the model and select Extend from... .
    2. In the dialog, do the following:

      1. In the Name field, enter MyCoupledClutches.
      2. Click the Insert in field, and then, in the Package Browser, select MyExtendedModelExamplesLib.

  4. Save the library by clicking Share > Save.

Result: You can now add components and connect them to the extended model.

Notes:
  • You cannot manipulate the inherited (extended) objects, that is, you cannot move them or change their size.
  • The original idea of not being able to delete inherited objects has been revised. You can now do this using selective model extension. For more information, see Removing Inherited Components and Connections from an Extended Model.