Copying/Moving Diagram Items Between Diagrams (SWC Editor)

Note

This topic applies only to SWCs specified as block diagrams.

To cut/copy diagram items from one diagram and paste them to another diagram, proceed as follows:

  1. In the drawing area, select the diagram items you want to cut or copy.

    A selected item is marked by handles at its edges.

  2. To cut or copy the selected items, do Closedone of the following.

    • In the Edit menu, select Cut or Copy.
    • Press <Ctrl> + <x> or <Ctrl> + <c>.
    • Click Cut or Copy.
  3. Open the target component and load the target diagram.
  4. To paste the items, click in the drawing area of the target component and do Closedone of the following.

    • In the Edit menu, select Paste.
    • Press <Ctrl> + <v>.
    • Click Paste.

    One of the following happens:

    • If no method/runnable is available in the diagram, and the selected diagram items contain method-/runnable-local elements, the Create new Method window opens. It suggests the creation of a new method/runnable.

      Note

      Continue reading at step 6.

    • The Select Method window opens. It lists all methods/runnable in the current diagram that can be used as target, and it offers the possibility to create a new method/runnable. Name or type conflicts (see Copying or Moving Graphical Items) are indicated by a warning icon in front of the method/runnable name.

    • The Ignored Elements window opens. It lists all elements that cannot be pasted to the target component or target method/process/runnable.

      Note

      Continue reading at step 7.

  5. In the Select Method window, select an existing method/runnable, or create a new one, and click OK.

    If you selected an existing method/runnable with name conflicts, an Element Name Conflict window opens for each conflicting item. It offers Closedseveral solutions. Continue as follows:

    Keep

    The existing element replaces the copied element.

    Overwrite

    The copied element replaces the existing element.

    Create New

    (not available for return values)

    Pastes the copied element to a new element named <element name>_<n>, <n> being the lowest integer number that causes no name clash.

    If the renamed element causes a new name conflict, renaming is done in alphabetical order; see the Closedexample.

    Cancel

    Aborts the paste procedure.

    The Apply to the next <x> conflicts option allows you to apply your selection to all name conflicts.

    1. In the Element Name Conflict window, solve the name conflicts all in once or individually.

    If you selected an existing method/runnable with type conflicts, an Element Type Conflict window opens for each conflicting item. It offers Closedseveral solutions. Continue as follows:

    Keep

    The existing element replaces the copied element.

    Note

    Keeping an element of different type (e.g., log vs. cont, array vs. scalar) than the copied element can lead to an invalid model.

    Overwrite

    The copied element replaces the existing element.

    Note

    Replacing an existing element with a copied element of different type (e.g., log vs. cont, array vs. scalar) can lead to an invalid model.

    Create New

    (not available for return values)

    Pastes the copied element to a new element named <element name>.

    If the new element causes a name conflict, it is renamed to <element name>_<n> (<n> being the lowest integer number that causes no name clash); see the Closedexample.

    Note

    It is strongly recommended that you use Create New.

    Cancel

    Aborts the paste procedure.

    The Apply to the next <x> conflicts option allows you to apply your selection to all type conflicts, with the exception of conflicting return values.

    1. In the Element Type Conflict window, solve the type conflicts all in once or individually.
    2. If you chose Keep or Overwrite, edit the model and change the invalid parts.
  6. In the Create new Method window, click Yes to create the new method/runnable and paste the diagram items.
  7. In the Ignored Elements window, click Continue to paste the allowed diagram items.

    Note

    The model will be invalid, due to the ignored elements. You must edit it before you can use it.

See also

Copying/Moving Diagram Items in the Same Diagram

Copying or Moving Graphical Items

Editing Sequence Calls