Dragging a Model, Block, Type, or Record to the Component Browser

You can drag a model, block, type, or record from any browser to the Component Browser and select the action to be performed with that class.

Actions that may be possible are:

  • Changing class of the target component
  • Adding component
  • Adding class parameter
  • Adding base class

The browsers you can drag classes from are presently:

  • The main Package Browser
  • Any light Package Browser
  • The Preferred Classes Browser
  • The Proposed Classes Browser
  • The Classes for Forced Elements browser


Before you begin: Activate the class, for example, a model, that is the target for dragging classes from a browser.
  1. From any browser listed above, drag a model, block, type or record to the Component Browser and drop it on any part of the Component Browser tree.
  2. Depending on what you drag and on what part of the tree you drop it, you can select from the following alternatives:
    • Change class of component to exchange the class of the target component to the class that you drag and drop.
      Notes:
      • You must drag to a top-level component to be able to select this alternative.
      • When you select this alternative and click OK, if connections or other modifiers no longer match, you are asked to confirm the exchange, and in that case non-matching items are removed.
      • For more information on exchanging classes, see Exchanging a Component Class.

      If this action is possible, it is the default action.

    • Add component to add a component of the class that you drag and drop.

      If this above action is not possible, Add component is the default action.

      Note: When you select this alternative and click OK, a dialog box for variable declarations for the component appears. For more information, see Defining Parameters and Editing Properties of Parameters.
      Important: Do not apply this action on classes containing graphics, graphics is not transferred by this command.
      Tip: Since this action is actually an instantiation, it is useful when, for example, you want to conveniently create parameters by instantiating types from Modelica.SIUnits. (These types contains no graphics.)
    • Add class parameter to add a class parameter, that is, a local replaceable class. They can be changed for some components.
      Notes:
      • When you select this alternative and click OK, a dialog box for defining the class parameter appears. For more information, see Working with Replaceable Components.
      • An application example for this feature could be building a car model, where the class Wheel is suitable to implement as a local replaceable class (class parameter).
    • Add base class to add a new base class.
      Note: When this selection is possible to select, multiple base-classes are legal.