STEM help / Editor skills

4.15.1 Copying and pasting elements

To copy model elements in a view, you must first select the icons for the desired elements, holding down the <Shift> key if necessary. Then there are a number of ways to proceed:

  • select Copy from the main Edit menu, or
  • select Edit/Copy from a menu on one of the selected icons, or
  • press <Ctrl+C> (when the main Editor window is active).

To paste over model elements, you must first select the icons for the target elements, then:

  • select Paste Link, Paste Formulae or Paste Values from the main Edit menu, or
  • select Edit/Paste Link, Edit/Paste Formulae or Edit/Paste Values from the menu on one of the selected icons.

These paste commands are only available if just one element was copied, and all the currently selected icons are of the same type. (It is not possible to paste data between several elements at the same time, because it would be difficult to match alignment and identify source/target icons respectively.)

To paste new elements:

  • select Paste Elements from the main Edit menu, or
  • press <Ctrl+V> (when the main Editor window is active).

Icons representing the copied data float on the screen: using the mouse or cursor keys, position these icons appropriately, and then click or press <Enter> to complete.

Note: In line with most other Windows applications, STEM supports the use of the <Ctrl+Insert>, <Shift+Insert> and <Shift+Delete> accelerators in addition to the <Ctrl C/V/X> keys to effect Copy/Paste/Cut, respectively.

Using drag and drop to copy elements

Alternatively, you can use the drag-and-drop technique to copy and paste in a single operation:

  1. Select icons for the elements you want to copy.
  2. Hold down the <Ctrl> key, then drag with the mouse.

The effect of the operation depends on where you ‘drop’ the icons. If you drop the icons on the application workspace (view desktop), the Editor will ask you to choose between pasting new elements, off screen, in the original view, or creating a new view, optionally in a new model. If you drop the icons on a view, the action depends on how the view is related to the selected icons. These actions are summarised as follows:

Drop Icons Action
Application workspace – Editor prompts to choose outcome

New elements pasted off screen, in the original view
New view created in the same model, with the selected icons
New elements pasted into a new model.
Original view New elements pasted into the original view
Another view in the same model New icons for the same elements created in the other view (without changing the model structure) – Editor prompts before moving any existing, duplicate icons
A view in another model New elements pasted into the other model

Figure 1: Options for copying elements with drag and drop

If just one element was copied and you drop it on another icon of the same type, the Editor will ask you whether to paste a link, formulae or values over the target element. You can also use an extension of this mechanism to define relationships between many different types of element – see 4.4.8 Connecting elements.

If the icons are dragged anywhere else, the ‘no-go’ symbol appears, meaning that they cannot be dropped.

Understanding relationships between copied elements

More generally, STEM will preserve relationships between copied elements where possible:

  • A copied Service will have the same Resource Requirements as its original, but if a given Resource is copied at the same time, the new Service will have a requirement for the corresponding new Resource.
  • A copied Resource will have the same Capital Cost Structure as its original, but if a given Cost Index is copied at the same time, the new Resource will use the corresponding new Cost Index instead.
  • Element choices, such as a Service Market Segment, will be interpreted relatively if the referenced element is copied at the same time.
  • References to other elements in formulae will also be interpreted relatively if the referenced element is copied at the same time.

However, STEM will not make such modifications if the original relationships are inherited by default, through formulae for the elements themselves. For example:

  1. Service 1 has a requirement for Resource 1, and Service 2 defaults to Service 1 (established by pasting a link from Service 1 to Service 2);
  2. if Service 1 and Resource 1 are copied together to create Service 1A and Resource 1A, Service 1A will have a requirement for Resource 1A; but
  3. if Service 2 and Resource 1 are copied together to create Service 2A and Resource 1B, the link to Service 1 will be copied, so that Service 2A also defaults to Service 1, which means it will still inherit a requirement for the original Resource 1 and not for Resource 1B.
  4. However, if all three elements are copied together to create Service 1B, Service 2B and Resource 1C, Service 2B inherits a modified requirement for Resource 1C from Service 1B, and the internal relationships are preserved.

Figure 2: Relationships between copied elements

Exceptions when copying elements between models

When an element is copied into another model, no attempt is made to identify the element with any existing element with the same name.

If you want to copy the data from an element in one model to an existing element in another model, then you should use the Paste Link/Formulae/Value mechanisms described above. However, it is not possible to superimpose a set of relationships in this manner, because you can only paste over individual elements at any one time.

Direct references to other elements, such as a Service’s Market Segment, can only be made to elements within the same model. If a Service and Market Segment are copied into another model together, the new Service will refer to the new Market Segment. However, if only the Service is copied, the new Service cannot retain the reference to the Market Segment in the original model, and will be set to <none>.

References can be made to elements in other models inside formulae. This is called an external link. STEM can create external links implicitly, if you copy an element into another model, when the original element has a formula referencing another element in the original model which was not copied. The newly created element will have a formula referencing the other element in the original model. If you prefer, you can disable this behaviour by de-selecting Copy External Links from the Options menu. When disabled, STEM will automatically freeze the formula in the new element.

 

© Implied Logic Limited