Creating a Class

In a logical behavior or in a behavior library, you can create a Modelica class and define its class type (package, model, component...).


Before you begin: Create a library.

In this scenario, you will create a model in a behavior library. Such class can be re-used.

Related Topics
About Dynamic Behavior Modeling
  1. Select New Class from the Authoring toolbar.

    Tip: This command is also available from the contextual menu of a selected class, in the Package Browser.

    The New Class dialog box appears.

  2. From the mandatory Name field, enter a valid Modelica name for this new class.

    Warning: Do not use the following names:
    • PLMInterface
    • PLMConnectors

    These names are reserved for packages automatically created in logical behaviors (for ports mapping purpose).

  3. From the Class type drop-down list, select the Model type. By default, this Model type is selected.

  4. Click the mandatory Insert in field, then select a library from the Package Browser.

    Tip: You can make your selection from the Package Browser before launching the New Class command. Your selection will be displayed from the Insert in field but can still be modified.

    Warning: When creating a class in a logical behavior, you cannot insert a class in these two packages:
    • PLMInterface
    • PLMConnectors

    These packages are created along with a new logical behavior and are reserved for ports mapping purpose.

  5. If you need to create a partial class, check the Partial option.

    Note: A partial class is used as a template to be inherited to create a full class.

  6. If you need to create an extended class:

    1. Click the Extends field,

      Tip: This command is also available from the contextual menu of a selected class, in the Package Browser.

    2. Select a class from the Package Browser or use Switch between class and basic type selection to select a basic type from the drop-down list.

    Tip: From the Package Browser, a Filter symbol helps you selecting a class corresponding to your class type choice.

  7. From the Store in drop-down list, select a representation to store the new class within the database. For the purpose of this scenario, you will store this new class in a new PLM representation.

    1. Select New behavior library.

      The New / Behavior Library Representation dialog box appears:

    2. Enter a name for the new behavior library representation.

      Important: This new behavior library representation will be used only to store the new class into the PLM database. It will not appear from the Package Browser. However, you can see it when displaying the structure of a library.

    3. Click Finish.

      In the New Class dialog box, the Store in Repository is filled in.

    Important: The options available in the Store in drop-down list directly depend on the content of the Insert in field.

    When a new class is inserted in:

    • a logical behavior: the class is stored in this logical behavior.

    • a behavior library: the class is stored either in this behavior library or in a new behavior library.

  8. Click OK to close the New Class dialog box and create your new class.

    From the Package Browser, a new class is created under the library node.