Function Syntax: NCopyExtra Version: 1 Date: 13.10.2025 AI+https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-ncopy-multiple-at-same-place-or-pause-the-ncopy-command/td-p/10932882 Command name NCopyExtra — type NCopyExtra at the AutoCAD command line. Additional commands: NCopyExtraD, NCopyExtraW, NCopyExtraI, and ClassicalNCopy. Description This AutoLISP / Visual LISP routine copies selected objects from an attached XREF into the current drawing. It uses a dialog-first workflow where the user can pick a rectangle, select or identify an XREF, choose Crossing or Window mode, and control copy options before the geometry is transferred. The copied objects are transformed into the host drawing position and can be placed either on _hilfslinien or onto a clean local layer name with the XREF prefix removed. It preserves the original object geometry and can match layer properties such as color, linetype, and lineweight from the original XREF layer. Main DCL workflow 🚀 The command NCopyExtra opens the dialog immediately. 📐 The Pick Rectangle on Screen button closes the dialog, lets the user pick P1 and P2, then reopens the dialog with the coordinates filled in. 🔍 The Pick XREF on Screen button helps identify an XREF graphically and confirms it in the XREF list. 🧩 The dropdown lists all resolvable XREFs in the current drawing and supports a wildcard filter. 📦 The user can choose Crossing or Window selection mode. ⚙️ Options control layer property transfer, placement on _hilfslinien, and a single UNDO group. User interaction • The user selects a host rectangle and an XREF before confirming the copy operation. • The OK button is enabled only after the rectangle and XREF selection are valid. NCopyExtraW can zoom to the visible XREF area, draw a preview boundary box, and offer Copy All or Pick Rectangle options. NCopyExtraI prints coordinate, XREF path, nesting-chain, bounding-box, and unit-scale diagnostics. ClassicalNCopy lets the user repeatedly select nested objects one by one until Enter or Esc is pressed. High-level workflow • Accesses the current AutoCAD document using ActiveX / VLA / VLAX. • Reads the XREF catalogue from the block table and filters valid external references. • Resolves direct or nested XREF placement using the block hierarchy and transformation matrices. • Opens the XREF drawing through ObjectDBX when required. • Converts the host drawing rectangle into XREF-local coordinates. • Scans XREF model space objects by bounding box using Crossing or Window logic. • Copies matching objects into the active drawing with CopyObjects. • Applies the correct transformation matrix with vla-transformby so the copied entities appear in the correct host location. • Optionally removes the XREF prefix from the original layer name, for example _XREF|LayerName becomes LayerName. • Ensures the destination layer exists, creating it when needed. • Copies key layer properties from the XREF layer to the clean local layer. ClassicalNCopy mode • The user is repeatedly prompted to select an object to copy. • The routine continues in a loop until the user cancels selection or presses Enter. • It uses nentselp to select nested XREF objects and retrieve transformation context. • It reads the selected object entity data with entget, including the layer stored under DXF group code 8. • It creates a new entity from the original entity list using entmakex. • It applies the nested selection matrix with vla-transformby. • It assigns the copied entity to _hilfslinien or to the trimmed local layer, depending on the saved option. Functionalities ✅ Dialog-driven XREF copying from rectangular selection windows. ✅ Object duplication from XREF model space into the current host drawing. ✅ Automatic XREF layer name cleanup. ✅ Automatic creation of destination layers when needed. ✅ Layer standards carry-over from the XREF layer to the local layer. ✅ Optional placement of copied entities onto _hilfslinien. ✅ Optional single UNDO group for safer editing. ✅ Debug reporting with NCopyExtraD. ✅ XREF location preview with NCopyExtraW. ✅ Coordinate and nesting diagnostics with NCopyExtraI. Important commands and calls highlighted nentselp — interactive nested selection that provides transformation context. entget — reads the original entity definition. entmakex — creates a copied entity in the drawing database. CopyObjects — copies scanned ObjectDBX objects into the active drawing. vla-transformby — applies the transformation matrix for correct position and orientation. vla-item and vla-add — read and create layers in the drawing. vla-put-Color, vla-put-LineType, and vla-put-Lineweight — transfer layer properties. vla-put-layer — assigns the copied entity to the target layer. setcfg and getcfg — store and reload persistent NCopyExtra settings. Operational notes and limitations ⚠️ This routine depends on Visual LISP ActiveX and ObjectDBX functionality. ⚠️ The XREF file path must be resolvable; unloaded, unresolved, overlay, or complex nested references may require diagnostics. ⚠️ It copies database objects and applies transformations; complex custom/proxy entities may behave differently depending on object type and available object data. ⚠️ The temporary DCL file is created in the AutoCAD temporary folder and deleted after use. Use case Ideal for CAD and Civil 3D users who need to bring selected XREF geometry into the active drawing while keeping the placement correct and converting prefixed XREF layer names into clean local drawing layers. Tags 🏷️ AutoCAD, 🏷️ AutoLISP, 🏷️ Visual LISP, 🏷️ Civil 3D, 🏷️ XREF, 🏷️ Xref Copy, 🏷️ Nested Copy, 🏷️ ObjectDBX, 🏷️ Layer Cleanup, 🏷️ CAD Automation, 🏷️ DCL, 🏷️ NCopyExtra