Create Empty Enumeration Types
You can create empty enumeration types, to later add elements.
To create an empty enumeration type, create a new class with certain selections:
For full information about creating a class, see Create a New Class or Extend from an Existing Class Using the New Class Command.
- From the Behavior Authoring section of the action bar, click New Modelica Class .
- In the New Class dialog box:
- In the Name box, enter the name of the enumeration type, in this scenario enter MyEnumeration.
- From the Class type list, select the Type type.
- Make sure that Partial is not activated.
- Make sure that no class is selected for Extends.
- Click OK.
A new class
MyEnumeration
is created and appears in the Package Browser.Tip:
You can also use Modelica Editor in the model and create the enumeration type by typing type MyEnumeration = enumeration(:); in the declaration part of the code, that is, where you declare parameters and variables. For more about the Modelica Editor, see Displaying and Editing Modelica Text. |