Files
OpenNest/docs/copy-paste-parts.md
T
ajandClaude Opus 5.5 2503c05d71 feat(ui): copy and paste parts between nests
Two nests that should have been one (a thickness saved as 0.1196 instead
of 0.12 kept N26-2CN and N26-2CH apart in Auto Nest) could only be joined
by re-importing drawings and re-nesting. Copy and Cut now also remember
the selected parts, and Paste (Ctrl+V) and Paste in Place (Ctrl+Shift+V)
put them into whichever nest is active.

A paste adds an exact copy of each drawing the target lacks, with its
required quantity, uses a same-named drawing with the same geometry, and
refuses a different drawing with the same name, since a nest cannot hold
two. Drawings are captured at copy time, so later edits or undo in the
source do not change what is pasted. Clipboard keys in text boxes now
edit the text instead of acting on parts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 11:35:06 -05:00

2.6 KiB

Copying parts between nests

Edit > Copy (Ctrl+C) and Cut (Ctrl+X) remember the selected parts as well as starting the usual placement on the current plate. Edit > Paste (Ctrl+V) and Paste in Place (Ctrl+Shift+V) put them into whichever nest window is active, the one they came from or another. This is how two nests that should have been one (for example a thickness saved as 0.1196 instead of 0.12) are joined by hand.

Piece Where
Capture and paste plan (drawing matching, refusals) OpenNest.IO/CopiedParts.cs
Menu commands, guards, status text OpenNest/Forms/MainForm.View.cs (PasteCopiedParts)
Placing with the cursor OpenNest/Actions/ActionClone.cs
Tests OpenNest.IO.Tests/CopiedPartsTests.cs; menu and undo in OpenNest.WinForms.Tests/Forms/UndoRecordingTests.cs

What is copied

  • Each part as it is: placed program, rotation, lead-ins and their lock, drawing pins off, cutting parameters, and the common-line groups among the copied parts.
  • Each part's drawing as the nest file saves it (NestWriter), so later edits, Undo or closing the source nest do not change what is pasted.
  • Cut-off parts are plate definitions and are never copied.

How a paste resolves drawings

For each copied drawing, by name in the target nest:

  • Missing: an exact copy is added with everything the file saves, including its required quantity, customer, priority and library link. A palette color takes the nest's next slot.
  • Same drawing (equal DrawingPackage.GeometryKey: geometry and geometry-bound data, not name, quantity, color or nesting settings): the nest's drawing is used and its required quantity is kept, so pasting the parts of several plates brings the demand over once.
  • Different drawing with the same name: the paste is refused; a nest cannot hold two drawings with one name. Rename one first.

Different units refuse the paste. Material and thickness are the nest's, not the drawing's, so they never block it.

Placing and undo

  • Paste adds any missing drawings as one undo step ("Paste") and then places with the cursor like Copy; each click is an "Add Parts" step.
  • Paste in Place puts the parts on the current plate exactly where they were copied from, selects them and records one "Paste in Place" step, drawings included. Nothing checks fit: the overlap display shows any collisions.
  • Both refuse while a fill or nest job runs on the target nest.

In a text box (and the other controls that undo their own typing) Ctrl+C, Ctrl+X, Ctrl+V and Ctrl+Shift+V edit the text and never reach the parts commands.