Creating an Empty Class or Extending from an Existing Class

New Modelica Class lets you create a new class, either by creating an empty class or by extending an existing class.


Before you begin: You have to be in a library to create a new class.
Note: As an exception, you can create free-standing models to, for example, test features.

In this scenario, you create a model in a behavior library. Such class can be reused.

  1. From the Name box, enter a valid Modelica name for this new class, in this example enter MyModel.
  2. From the Class type list, select the Model type.
  3. Click the Insert in box and select a library from the Package Browser.

    Important: To create a class as top-level class, do not enter a class name in the box.

  4. Optional: If you need to create a partial class, select the Partial option.
  5. Optional: If you need to create an extended class, click the Extends box and select a class from the Package Browser.

    Note: You can create an extended class of a basic type by clicking Switch between class and basic type selection .
    Tip: If you want to create a new class from an existing class but be free to change any component in the new class without changing the original class, you can create a new class by duplicating an existing class. You can do this by right-clicking the class in the Package Browser and select Duplicate Class.