LayoutTools

Short description

LayoutTools manages layout tabs to batch Lock or Unlock viewports, toggle AnnON or AnnOFF, and apply Zoom Extents or Zoom Window in Paper Space across selected or displayed layouts, with status tracking stored in the DWG.
layouttools 000

Command:

Commands and aliases
  • LayoutTools opens the main dialog.
  • LayoutTools is an alias that runs the same tool.
  • _LayoutTools is an alias that runs the same tool.

Description:

What it does from the user perspective
  • The user runs LayoutTools to open a DCL dialog listing layout tabs with status columns.
  • The user filters layouts by wildcard pattern such as * and ?, and can optionally Include Model in the list.
  • The user selects layouts in the list, or switches scope to All displayed to target every currently shown layout in the dialog.
  • Lock and annotation actions run immediately while the dialog remains open, and the list refreshes to show updated statuses.
  • Zoom actions are requested in the dialog, then executed after the dialog closes so point picking is safe for Zoom Window.

Helper function: (if any)​

Key helper logic used by the tool
  • QuietOn and QuietOff temporarily adjust CMDECHO and attempt NOMUTT to reduce command line noise, then restore prior values.
  • Robust layout filtering uses wildcard matching and optional Model inclusion, producing the displayed list and the action targets.
  • Viewport collection excludes the overall paper space viewport and can ignore viewports that are Off when Skip OFF VP is enabled.
  • Annotation status caching reads ANNOALLVISIBLE per tab by switching CTAB as needed, forcing paper space, and restoring the previous environment afterward.
  • Zoom status persistence stores a per layout flag in the DWG using Named Object Dictionary data with XRECORD, so the status survives reopening the drawing.
  • Clipboard export copies a tab separated report using an HTMLFile clipboard approach with a PowerShell and clip fallback when required.
  • Temporary DCL generation creates a unique dialog name per run, writes a temp DCL file, loads it, then cleans up the file and dialog after use.

Functionalities:

Functionalities
  • Layout list and selection
    • Filter layouts by pattern and refresh the list using Apply.
    • Toggle Include Model to show or hide Model from the list, while actions still avoid Model for viewport operations.
    • Choose targeting scope between Selected and All displayed layouts.
    • Use Select All and Select None to manage multi selection quickly.
    • Display per layout columns for lock state, annotation state, and zoom status.
  • Viewport locking
    • Lock locks paper space viewports across the target layouts using DisplayLocked.
    • Unlock unlocks paper space viewports across the target layouts.
    • Skip NoVP prevents actions on layouts that have no usable paper space viewports.
    • Skip OFF VP ignores viewports that are turned off when applying lock changes.
    • Lock status is shown as Locked, Unlocked, Mixed, NoVP, or Model.
  • Annotation visibility
    • AnnON sets ANNOALLVISIBLE to 1 for the target layouts.
    • AnnOFF sets ANNOALLVISIBLE to 0 for the target layouts.
    • Annotation state is displayed as AnnOn, AnnOff, or Ann? if it cannot be read.
  • Paper space zoom
    • Zoom Extents applies a paper space zoom extents in each target layout and records the status as ZExt.
    • Zoom Window prompts the user for two corners, applies the same window to each target layout, and records the status as Z-.
    • Zoom status is shown as ZExt, Z-, or Z? when unknown, and is persisted in the DWG.
  • Clipboard reporting
    • Copy exports a tab separated report of layout name, lock status, annotation status, and zoom status for the current target scope.
  • Operational safeguards
    • Actions are wrapped in a single undo mark per batch operation for easier rollback.
    • The tool restores TILEMODE, CTAB, and MSPACE after operations that switch tabs or paper space state.

Result:

Tags
  • Layouts, Viewports, Paper Space, DCL, Dialog_UI, Clipboard, Extra_AutoCAD, General_AutoCAD, Lisp
Suggested relevant tags not in the provided list
  • Zoom
  • Annotation
  • UndoMark or Undo grouping
  • Persistent DWG storage or XRecord persistence
  • Wildcard filter

Images, animations etc.

layouttools 000
Pixel

Additional info:

Share this page:

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Tags: CAD, Layouts, Lisp, Paper Space, Viewports
0
Would love your thoughts, please comment.x
()
x