Duplicating a Class

From the Package Browser, you can duplicate a class, in the same package or to another package.

If the duplicated class contains subclasses, the subclasses are also duplicated.

Important: When you duplicate a class to start to create a new class, consider extending instead of duplicating. For more information, see the first tip in Create a New Class or Extend from an Existing Class Using the New Class Command.

See Also
About Modelica Classes
  1. From the Package Browser, right-click a class and select Duplicate Class.

    Tip: You can also use the shortcut Ctrl+Shift+D.

    The Duplicate dialog box appears.
  2. In the dialog, do the following:
    1. Optional: In the Name box, change the name.

      Notes:
      • When copying to another package, you can keep the name.
      • When copying in the same package, if you keep the name, the duplicate gets an additional number when created.

    2. Optional: Enter a description for the copy.
    3. Click the Insert in package box, and then, from the Package Browser, select the package for the duplicate.
    The duplicate is created.