Cloning | CPN Tools help |
How-to |
Inscriptions can also be cloned. Doing so will result in a cursor with the inscription attached that may be applied to a suitable element. This can be used to easily copy complicated inscriptions, e.g. arc inscriptions or code segments, that are needed in several places.
Cloning of groups of elements is an extension of the basic cloning, where more than one element is cloned at the same time.
If a group is selected, and the target of the clone tool is a member of the selected group, then the elements in the group will be cloned. As with cloning of individual elements, the result is a cursor with the cloned elements attached that may be used to insert them one or more times.
Note that there are some restrictions on what can be cloned in this way. The cloned group of elements must not have any dangling arcs (arcs with one or two endpoints not in the group), attempting to clone a group with dangling arcs result in an error message similar to the one below. Similarly inscriptions cannot be cloned as part of a group unless the element they are attached to is also in the group.
If a group of elements contains substitution transitions, then new instances of the subpages will be created when the group of elements is cloned, i.e. the subpages are not cloned. Cloning subpages is described on the help page for deep cloning.
Every cloned element can be placed in a arbitrary open net. In this way cloned elements can be transported across net. The same goes for groups of elements, meaning you can clone entire groups of elements to other nets.
Cloning subpages between nets is somewhat complicated. The hierarchical relationships that are created in the new net depend on the way in which new objects are created, as described below.
Assume that a group of elements containing a substitution transition has been cloned in one net by applying the Clone element tool to an element in a group. The tool-in-hand is now a clone of a group of elements.
When this tool is applied several times in another net before applying the Drop Tool tool, then several instances of the subpages will be created. For example, applying the tool, shown above, two times in a net (different from the net from which the clone was made) will result in two instances of the page named Subpage (clone)
. These instances are shown below as Subpage (clone) (1)
and Subpage (clone) (2)
.
Another way to clone subpages between nets is to:
Subpage (clone)
, but they will otherwise be unrelated to each other. In the example below, the two pages named Subpage (clone)
are completely independent from each other.
The clone instrument also allows cloning of a page, or a hierarchy of pages. In this case a new page is created for each page in the cloned hierachy (the page being cloned and all of its subpages), each with the text "(clone)" appended to its name.
The top page will be cloned, and it will be independent of the original page, but for all subpages, there will be created new instances of the original subpages. Once pages have been cloned, it is possible to rearrange them in the hierachy (as described in Working with hierarchical nets) if need be.
Guidelines, groups and fusion sets are also cloned to the new page containing the cloned elements of the original page.
Currently it is not possible to clone a page between nets. A workaround to this problem is to create a new page in the other net. Then clone the elements of the page you wish to clone and place them on the new page in the other net. Since guidelines can not be part of a group and groups can not be part of another group, so guidelines and group have to be made by hand also. Notice any guideline or group on subpages of the elements cloned to the new page will have their guidelines and groups to the new net.
Cloning a group is not the same as cloning the elements of a group. When a group is cloned, a new group is created with (initially) the same members as the original group. Members may then be added to or removed from the new group using the Toggle group tool, as if the group had been created with New Group.