Selecting or Activating a Class

You can select or activate a class using the Package Browser.

The Package Browser displays the libraries loaded in session, and the functional and logical behaviors.

The root level displays all the libraries, and functional and logical behaviors, that are loaded in session.

The levels below display the packages (that is, sublibraries) containing all the classes that can be instantiated.

This task shows you how to:

Select a Class

You can execute an object-action command on a selected class, even if it is not the activated class.

  1. In the Package Browser, expand a root package to see the packages and classes.
  2. To select a class in the Package Browser, click it.
    When a class is selected, it is highlighted in turquoise in the Package Browser:

    Note: The selected class might be another class than the active one. In the image above:
    • In the Package Browser, the Motor class is selected, but MyPendulum is the active (opened) class.
    • In the Component Browser, the active class MyPendulum is displayed.
  3. You can now execute any object-action command on the selected class.

Activate a Class

You can activate a class.

Important: To be editable, a class must be activated and unlocked. For information about locking and unlocking, see Locking and Unlocking a Class.

  1. To activate a class, from the Package Browser, double-click it.

    Tip: You can also, from the Package Browser, right-click the class, and then select Display Class > Show Class.

    From the example above, activate the class Motor.

    The class is highlighted in turquoise in the Package Browser, and it also appears in the Component Browser.

  2. If the class is not locked, you can now edit it. For example, you can instantiate a class, or create a new class in an active package.

    Note: If you now select another class without opening it, for example SpringMass, you get:

    Now SpringMass is selected, but Motor is still the active (open) class.

Select a Class with the Class Selector Box

In many dialog boxes, you can select a class with a class selector box.

Before you begin: Open a dialog box with a class selector box. An example is the New Class dialog box that is displayed when creating a new class. In this dialog box, two class selector boxes are present, one for Insert in and one for Extends.
Note: Only the class selector box is described here.
  1. Select the class selector box, if not selected by default.
    The background of the text in the box is blue.
  2. To define a class, do any of the following:
    • In the Package Browser, select the class.
    • In the class selector box, search for the class.
      1. To edit the class selector box, select it.
      2. Enter a part of a class name.
        Important:
        • The search is not case sensitive.
        • Wildcards are not taken into account.
        • The search is performed on text criteria and does not consider class compatibility. A message appears if the class is not applicable.
      3. Right-click the box and select Find Modelica class.

        The search result is visible in the Package Browser in Search mode.
        Warning: You have to enter a text, you cannot search for all classes.
      4. Select the wanted class in the Package Browser.
      5. To exit the search mode, in the Package Browser, click Back to Library View .
    • Click the class selector box and type the full class name.
    A class path is entered. If the system cannot find the path, you are notified.