XPSWMM uses an internal buffer to move or copy information between objects, cells in lists and fields in dialogs. Data may be “copied” between certain objects and elements, in which case the original data remains unchanged, or it may be “cut”. In the case of cutting data, the data is copied into the copy buffer. After the data is subsequently pasted, the data in the copied object is cleared and reset to its default value.


“Copying” or “cutting” of object data is restricted to either one item of a dialog or to the entire data structure of a node or link. Data can only be pasted into similar objects i.e. node data cannot be pasted into any object except for the same type of node. This is transparent to the user so you may select a multitude of different types of objects before “pasting” and the data will only be pasted into objects of the same type and mode as the parent.

Data within the buffer remains active until the program is ended or another copy command is executed. At that point, the buffer data is overwritten with a new copy or cut command. Data may be copied between databases by closing the current database, opening the new one and then Pasting from the Copy buffer.

Copy Data From a Single Object

To copy all of the data associated with a node or link to one or more other similar items in one operation, first select the node or link to be copied and then select “Copy” from the Edit menu. The copied data is all data for the current mode. A keyboard equivalents of <Ctrl>+C and also exists for this command. After selecting an object the “Copy” and “Paste” is also available from the popup menu using a right mouse click. If the copy operation is successful XPSWMM will then reports how many records have been copied into the buffer. For example:

 

To cut the data including the object from the model and have the contents reside in the buffer for a paste operation simply choose the “Cut” command from the Edit menu or use the <Ctrl>+X. If an object of similar type is selected then pasting will copy the cut data into the new object. If no object is selected then pasting will recreate the object with all of the cut data.

To paste the copied data select one or more objects (by holding down the <Shift> key and clicking on multiple objects or by dragging a dotted rectangle around the selected objects) and hit <Ctrl>+V or select “Paste” from the Edit menu. XPSWMM will now report to the screen the number of objects data has been pasted into and the number of records pasted. For example:

 

When a multi-link is copied and pasted to a single conduit link, XPSWMM will ask which conduit is to be copied from. The user must specify the conduit number before the paste is completed. Selecting ‘Cancel’ will not copy the data to any multi-links in the selection set.

Copy Multiple Objects

To copy both the graphical attributes plus all the data associated with a node or link, first select one or more objects by either dragging a box around them, or individually selecting objects using the <Ctrl> key. Copy the objects by selecting "Copy" from the Edit menu or <Ctrl>+C. If the operation is successful XP will report the number of database record and objects copied. For Example:

Many types of objects can be copied, including nodes, links, and text elements. When a link is copied the end nodes are also copied (because a link cannot exist without end nodes) so that pasting into an empty selection will properly create the copied link. A single link copied can still be pasted into a multiple selection in the usual way.

To create new objects deselect all objects by clicking in open space then select "Paste" from the Edit menu or <Ctrl>+V. New objects will be created slightly offset from the original location and will be highlighted. They will also have new names automatically created by adding “.1” to the name if that name is not already in use. It may be necessary to clean up the screen by selecting "Redraw" from the toolstrip or from the "View" Menu. The objects can be renamed if the new name is not suitable before solving.

When objects are pasted into a different database than that copied from, global database references are maintained but the actual data for the global database records (the global database definitions) are not pasted. These Global Data bases can be merged from one .XP project to another or single global database records can be copied from a source database into the copy buffer and then pasted into a target project. The Merge command is located in the File menu. It is also possible to export global database records from one file and import them into another.

Copy a Single Item

To copy an individual item, open up the Dialog Box for the source object, select the copy icon (white multi-page) in the upper right-hand corner of the dialog then select the field or button by clicking on it. All text items, radio buttons or checkboxes can be copied in this manner. Close the Dialog Box.

To paste the copied data select one or more objects by holding down the <Ctrl> key, and clicking on multiple objects or by dragging a dotted rectangle around the selected objects. Select “Paste” from the Edit Menu or hit the <Ctrl>+V keys. All links and all nodes can be selected by using the All Links and All Nodes icons on the toolstrip or the View->Select Objects menu commands.

When copying a field or string value, the value is checked as if it were to be saved to the database before copying. For Radio Button items, only the active item in the group of buttons can be copied. For both Radio Buttons and Checkboxes with underlying data, only the flag itself and not the whole underlying data structure will be copied. Only single data items can be copied, structures including all underlying data cannot be copied as single items. However, when copying all of the data for an object all the underlying data is copied to the copy buffer and can be pasted to another object.

Copy a Dialog List (DLIST) Item

To copy a single cell in a dialog list (DLIST) first move the text insertion point to the cell you wish to copy. Select the text or numerical string by double-clicking or depressing the mouse and dragging over the entire string. Right mouse click to get a Window’s pop-up dialog and select Copy from the list. Alternatively using <Ctrl>+C will copy the selected string. Next move to the text insertion point to the cell(s) where you wish to insert the data and paste the data from the buffer using the right mouse click pop-up dialog or <Ctrl>+V and repeat as many times as necessary. If the DLIST is blank it will be necessary to Insert a row so that the right mouse button can display the pop up menu including the copy, cut and paste commands. Copying many cells or one cell to many is permissible in the DLIST using the spreadsheet style grid.

Copying Global Data

Single records of a global database can be copied using the Copy button from the  Global Database. In the example shown here, all of the Rainfall records in the source database are copied into the paste buffer.

After opening up a new target database the records are pasted by selecting Paste from the Edit menu. When pasting database records, new records are always created in the current database. If record names clash with existing names, unique names based on the original name and a numerical extension will be generated.


All Global Databases from one XPSWMM file can be copied into the current XPSWMM file by using the Merge command.


Another alternative to copy and paste of Global Database items is to export them from the File > Export Data menu. This will allow a selection of global database records that can be exported