Copy2Layouts

Short description

  • Opens a dialog to pick objects once, then copies them to multiple selected paper-space layouts, showing only the total selected object count.
  • Includes a wildcard layout filter and multi-select layout targeting with Select All and Select None actions.
copy2layouts 000

Command:

  • Commands: Copy2Layouts and macro-friendly alias _Copy2Layouts

Description:

  • Creates a temporary DCL file each run and assigns a unique dialog name so the dialog definition cannot collide with older cached DCL definitions.
  • Lets the user pick a selection set from the drawing and displays Total: N only, without any object-type breakdown.
  • Lists only paper-space layouts (excludes Model) and supports filtering layout names using wildcard patterns * and ?.
  • Copies selected objects to the target layouts using ActiveX CopyObjects into each destination layout’s paper-space block, wrapped in an UNDO Begin/End group for one-step rollback.
  • Runs as a looped dialog workflow: Apply Filter and Pick return to the dialog, Copy completes the operation and exits on success, Close exits without changes.

Helper function: (if any)​

  • lc:unique-dialog-name generates a unique DCL dialog name from DATE to avoid dialog name collisions.
  • lc:_dcl-text builds the DCL definition lines, including object picking, total count text, layout filter row, multi-select list, and copy/close buttons.
  • lc:write-dcl writes the DCL lines to a temp .dcl file and returns the filename.
  • lc:cleanup unloads the dialog and deletes the temp DCL file to prevent leftovers across runs.
  • lc:get-paper-layouts returns layout names excluding Model.
  • lc:parse-indexes converts the list box multi-select index string into a usable list of integers.
  • lc:make-index-string builds “0 1 2 …” index strings for Select All behavior.
  • lc:fill-layouts fills the layout list box and reapplies the stored index selection string.
  • lc:get-ss-count returns the current selection set count, or zero if none is present.
  • lc:set-copy-enabled enables or disables the Copy button based on whether the selection set contains objects.
  • lc:apply-layout-filter applies wildcard filtering to the full layout list and resets selection to avoid index mismatch after filtering.
  • lc:populate-dialog refreshes the dialog fields: filter text, layout list, total count, and Copy button availability.
  • lc:select-all-layouts selects all layouts in the filtered list only.
  • lc:select-none-layouts clears all selected target layouts in the dialog.
  • lc:do-pick prompts the user to select objects and stores a valid PICKSET only if it has at least one entity.
  • lc:copy-to-layouts converts selected entities into VLA objects, builds a safearray variant, and calls vla-CopyObjects into each destination layout block, skipping the current tab.
  • lc:do-copy validates prerequisites (objects, filtered layouts, layout selection), maps indexes to layout names, runs the copy inside UNDO, and reports success or blocking errors.
  • lc:bind-actions wires all dialog controls with action_tile handlers and uses dialog return codes to drive the reopen loop.
  • c:Copy2Layouts controls the dialog lifecycle loop and ensures cleanup via a custom *error* handler; c:_Copy2Layouts provides an underscore alias for macros.

Functionalities:

  • Runtime DCL generation writes and loads a temp dialog with a unique name on each run.
  • Pick from drawing captures a selection set once and displays only Total: N in the dialog.
  • Layout filtering supports wildcard patterns * and ? and applies case-insensitive matching.
  • Multi-select target layouts copies to any subset of filtered layouts, with Select All and Select None for fast control.
  • Copy enable/disable disables the Copy button when no objects are selected to reduce invalid runs.
  • ActiveX CopyObjects copies converted VLA objects into each destination layout’s paper-space block to avoid command-based copy/paste issues.
  • UNDO grouping wraps the copy operation in UNDO Begin/End so the entire multi-layout copy can be undone in a single step.
  • Looped dialog workflow Apply Filter and Pick reopen the dialog, while a successful Copy ends the command.

Result:

  • On successful copy, selected objects are duplicated into each chosen paper-space layout and a confirmation alert reports completion.
  • If objects are not selected, shows No objects selected and instructs to use Pick first.
  • If no layouts match the filter, shows No layouts match the current filter and does not copy.
  • If no target layouts are selected, shows No target layouts selected and does not copy.
  • On close or cancel, exits cleanly after unloading the dialog and deleting the temp DCL file, without copying anything.

Images, animations etc.

copy2layouts 000
copy2layouts 001
copy2layouts 002
Pixel

Additional info:

Share this page:

Page Tag: Paper Space

  • Copy2Layouts

    Short description Opens a dialog to pick objects once, then copies them to multiple selected paper-space layouts, showing only the total selected object count. Includes a wildcard layout filter and multi-select layout targeting with Select All and Select None actions. Command: Commands: Copy2Layouts and macro-friendly alias _Copy2Layouts Description: Creates a temporary DCL file each run…

  • LayoutNum

    Short description Provides a DCL dialog to batch rename layouts using sequential numbering with optional prefix, suffix, and zero-padding, with filtering and preview. Supports in-dialog Apply and multi-level Undo without calling AutoCAD UNDO from DCL callbacks, to avoid stability issues. Command: Commands: LAYOUTNUM, _LAYOUTNUM, LayoutNum Description: Builds a unique DCL dialog definition at runtime and…

  • LockAllVp

    Short description Tags: Layouts, Paper Space, Viewports, DCL, Dialog_UI, Lisp, CAD, Clipboard Suggested tags not in list: ObjectARX, COM_Automation, Stability, Undo_Stack Command: • LOCKALLVP Open the dialog to lock or unlock viewports in selected layouts. • LockAllVp Alias command to run the same dialog workflow. • _LOCKALLVP Underscore alias for macro use. Description: This tool…

  • Zoom Extend

    Short description LZE summary LZE opens a DCL selection dialog for Layouts, then runs Zoom Extents in Paper Space on the selected layouts after the dialog closes. Key stability rule The zoom action is executed after the dialog closes to avoid UI timing issues. Command: Command LZE Runs Zoom Extents on selected layouts in Paper…

  • Zoom Window

    Short description LZW summary LZW opens a DCL selection dialog for Layouts, then prompts for a window and runs Zoom Window in Paper Space on the selected layouts after the dialog closes. Key stability rule The zoom action is executed after the dialog closes to avoid UI timing issues. Command: Command LZW Runs Zoom Window…

  • Delete Block

    Short description Comming soon … Command: Comming soon … Description: Comming soon … Helper function: (if any)​ Comming soon … Functionalities: Comming soon … Result: Comming soon … Images, animations etc. Lisp code: Expand Code ⬇ Select Code Copy Code Comming soon … Additional info: Based on / Source code: Open Website Share this page:

  • FreezeLayersInVP

    Short description Shows a DCL dialog to filter and multi-select layers, then freezes the selected layers in the current viewport using VPLAYER. Supports filtering by Current layers, Xref layers, or Current_and_Xref, with an optional Xref picker and a fixed-width “faux columns” layer list. Command: Commands: FreezeLayersInVP and alias FLVP Description: Builds an embedded DCL file…

  • TitleBlocksTools

    Short description Title Blocks Tools – Unified Menu System Comprehensive dialog-based interface for exporting and updating titleblock attributes via CSV with integrated help, file management, and reload utilities. Command: Commands: TitleBlocksTools, EXPTBCSV_EXPORT, UTB2 Description: This integrated toolset combines CSV export and import functionality for titleblock attribute management: Main Menu Dialog provides radio button selection between…

  • Match AutoCAD Screens​

    Short description Comming soon … Command: Comming soon … Description: Comming soon … Helper function: (if any)​ Comming soon … Functionalities: Comming soon … Result: Comming soon … Images, animations etc. Lisp code: Expand Code ⬇ Select Code Copy Code Comming soon … Additional info: Based on / Source code: Open Website Share this page:

  • Change Background Color

    Short description Changes AutoCAD’s model/paper background color using presets and keeps cursor/track/snap colors readable. Includes a dialog (DCL) with Apply/OK/Cancel and can restore the original colors if you cancel. Command: Command: c:BG Opens a DCL-based “Background Changer” dialog allowing you to pick a background color preset and apply it to Model and/or Paper space. Description:…