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) Description This routine copies a selected object and places the new copy onto a local layer name (xref prefix removed), while preserving the original object geometry and matching the layer properties (color, linetype, lineweight) from the xref layer. User interaction • The user is repeatedly prompted to select an object to copy. • The routine continues in a loop until the user cancels selection (for example Esc). High-level workflow • Accesses the current AutoCAD document and its layer table using ActiveX (VLA and VLAX). • Reads the selected object entity data, including its layer (group code 8). • If the layer is an xref layer (contains |), it trims the prefix and keeps only the part after the separator. • Creates a new entity from the original entity list using entmakex. • Applies the correct transformation matrix from the selection pick data so the copy appears in the correct position and orientation using vla-transformby. • Retrieves the xref layer object (full layer name including xref prefix) from the Layers collection. • Ensures the local trimmed layer exists, creating it if needed. • Copies key properties from the xref layer to the local layer (color, linetype, lineweight). • Assigns the new entity to the local trimmed layer. Functionalities • Object duplication that preserves the original entity definition using entget and entmakex. • Automatic xref layer name cleanup (_XREF|LayerName becomes LayerName). • Automatic creation of the destination layer if it does not exist (adds the trimmed name to the local drawing). • Layer standards carry-over from the xref layer to the local layer: Color is copied. Linetype is copied. Lineweight is copied. • Ensures the copied entity is placed onto the trimmed local layer via vla-put-layer. Important commands and calls highlighted nentselp — interactive selection that also provides transformation context (used for correct placement). entget — reads the original entity definition. entmakex — creates the new copied entity in the drawing database. vla-transformby — applies the selection matrix so the new entity matches the original’s position and orientation. vla-item and vla-add — reads and creates layers in the drawing. vla-put-Color, vla-put-LineType, vla-put-Lineweight — transfers layer properties. vla-put-layer — assigns the copied entity to the cleaned layer name. Operational notes and limitations • This routine depends on Visual LISP ActiveX, so include (vl-load-com) before running it. • It copies the raw entity data; complex or proxy entities may behave differently depending on object type and available DXF data. • The xref layer must exist in the drawing layer table under its full name for the property copy step to succeed.