Function Syntax: LayoutTools / _LayoutTools Version: 1.1 Date: 20.06.2026 6:38:55PM AI+ LayoutTools summary This program opens a dialog that lets the user filter and select layout tabs, then apply viewport locking, annotation visibility toggles, and paper space zoom operations across the chosen layouts. How the user interacts with it The user runs LayoutTools (or its aliases) to open a DCL dialog. The user can filter the layout list by name using wildcard patterns such as * and ?. The user selects one or more layouts in a multi select list, or switches scope to affect all currently displayed layouts. For Zoom Window, the program closes the dialog first, then prompts the user to pick two corners in the drawing. Main commands and aliases Primary command: LayoutTools Aliases: LayoutTools, _LayoutTools Core functionalities Layout filtering and targeting • Filter layouts by wildcard pattern, default * meaning all. • Option to Include Model in the list, otherwise Model is excluded from actions. • Scope switch between Selected layouts and All displayed layouts. • The list displays per layout status columns for lock, annotation, and zoom tracking. Viewport Lock and Unlock Lock sets DisplayLocked for paper space viewports in the targeted layouts. Unlock clears DisplayLocked for the same viewports. • Optional rules that modify which layouts and viewports are affected. Skip NoVP prevents actions on layouts with no usable paper space viewports. Skip OFF VP excludes viewports that are turned off, when evaluating which viewports to lock or unlock. • Lock status shown per layout as Locked, Unlocked, Mixed, NoVP, or Model. Annotation visibility control per layout tab AnnON sets ANNOALLVISIBLE to 1 for the targeted layouts. AnnOFF sets ANNOALLVISIBLE to 0 for the targeted layouts. • The tool reads and displays annotation state as AnnOn, AnnOff, or Ann? when state cannot be determined. • When applying annotation changes, it temporarily switches to each tab as needed, forces paper space, applies the setting, then restores the previous environment. Zoom operations in paper space across layouts Zoom Extents applies a paper space zoom extents in each targeted layout. Zoom Window applies a paper space zoom window using two user picked corners, then repeats that same window for each targeted layout. • Zoom is executed using ActiveX when possible, and falls back to command line zoom if ActiveX fails. • The tool tracks zoom status per layout as ZExt, Z-, or Z?. • Zoom status is persisted inside the drawing using Named Object Dictionary storage with XRECORD, so it survives reopen of the DWG. Clipboard export Copy copies a tab separated report for the current target scope. • Each line includes layout name, lock status, annotation status, zoom status. • Clipboard uses an HTMLFile clipboard interface first, with a PowerShell or clip fallback method if needed. What the dialog displays • A list of displayed layouts with fixed width formatting. • Columns per row: LockStatus, AnnStatus, Zoom. • Buttons: Select All, Select None, Copy, Lock, Unlock, AnnON, AnnOFF, Zoom Extents, Zoom Window. • A live count of selected layouts. Important behavior and safeguards • Actions avoid Model space by default and treat Model as not applicable for viewport operations. • Viewports of Number 1 in a layout are treated as the overall paper space viewport and are excluded from lock operations. • The tool wraps lock and zoom operations in an undo mark, allowing a single undo step for batch changes. • It uses a quiet mode by setting CMDECHO to 0 and attempts to set NOMUTT to reduce command noise, then restores original values. • It restores the previous TILEMODE, CTAB, and MSPACE state after annotation and zoom operations. One sentence description for quick identification This tool provides a batch layout manager to Lock or Unlock viewports, toggle ANNOALLVISIBLE via AnnON or AnnOFF, and apply Zoom Extents or Zoom Window across selected or filtered layouts, while tracking zoom status persistently inside the DWG. Description 🧰 LayoutTools is an AutoCAD and Civil 3D AutoLISP layout management dialog for zooming layouts, locking and unlocking viewports, and toggling ANNOALLVISIBLE. 📑 It supports filtered layout selection, selected or all-displayed scope, viewport lock status, annotation visibility status, zoom status tracking, clipboard copy, and batch paper-space operations. Function Syntax 🚀 Main dialog command: LayoutTools 🔁 Alias command: _LayoutTools 🧰 Load the LSP with APPLOAD and run the command in AutoCAD or Civil 3D. SEO Optimized Overview 🧰 LayoutTools is an SEO-friendly AutoCAD layout and viewport management utility for Civil 3D sheet production and paper-space cleanup. 📑 The routine creates a DCL dialog titled LayoutTools with filter, Include Model, Skip NoVP, Skip OFF VP, Selected versus All displayed scope, layout status table, Select All, Select None, Copy, Lock, Unlock, AnnON, AnnOFF, Zoom Extents, and Zoom Window. 🔒 Lock and Unlock change DisplayLocked on viewports found in the target layouts, helping protect viewport scales and sheet views from accidental edits. 👁️ AnnON and AnnOFF set ANNOALLVISIBLE across selected or displayed layout tabs, allowing faster annotation visibility control during checking and plotting. 🔍 Zoom Extents and Zoom Window run after the dialog closes for command-safety, then apply the chosen view action across the target layouts. 💾 The tool stores zoom status in a Named Object Dictionary XRECORD so the list can show ZExt, Z-, or Z? status for tracked layouts. 📌 This is useful for viewport locking, layout review, sheet cleanup, annotation checks, batch zooming, plot preparation, and Civil 3D plan sheet QA/QC. Primary Workflow 1️⃣ Load LayoutTools into AutoCAD or Civil 3D with APPLOAD. 2️⃣ Run LayoutTools from the command line. 3️⃣ Use the dialog or command prompts to select the target layouts, layers, viewports, or plot settings. 4️⃣ Review the preview, status list, or command-line feedback before applying changes. 5️⃣ Apply the operation and verify the result in the active drawing. Main Functionalities ✅ Filter layout tabs with wildcard patterns using * and ?. ✅ Display layout rows with lock status, annotation status, and zoom status. ✅ Choose Selected layouts or All displayed layouts as the action scope. ✅ Skip layouts with no viewports to avoid unnecessary processing. ✅ Skip OFF viewports when locking or unlocking, depending on the option. ✅ Lock all usable viewports on target layouts. ✅ Unlock all usable viewports on target layouts. ✅ Toggle ANNOALLVISIBLE on or off across target layout tabs. ✅ Apply Zoom Extents to multiple paper-space layouts. ✅ Apply one picked Zoom Window to multiple layouts. ✅ Copy layout status information to the clipboard. ✅ Store layout zoom status in the DWG Named Object Dictionary. Important Commands and Helper Functions 🧩 LayoutTools:WriteDCL dynamically creates the multi-action DCL interface. 🧩 LayoutTools:GetLayouts collects layout names and supports Model inclusion. 🧩 LayoutTools:FilterLayouts applies wildcard filtering to the layout list. 🧩 LayoutTools:GetLayoutViewports finds usable paper-space viewports in each layout. 🧩 LayoutTools:LayoutLockStatus reports viewport lock state per layout. 🧩 LayoutTools:SetAnnoAllVisible applies ANNOALLVISIBLE while preserving CTAB, TILEMODE, and MSPACE state. 🧩 LayoutTools:_SetLockedForLayouts locks or unlocks viewport DisplayLocked values in an undo mark. 🧩 LayoutTools:ZoomExtentsLayouts applies Zoom Extents to target layouts and records ZExt status. 🧩 LayoutTools:ZoomWindowLayouts applies the picked window to multiple layouts and records Z- status. 🧩 LayoutTools:CopyClipboard copies selected layout/status information using the Windows clipboard. Practical Result 🎯 The result is a centralized layout QA and viewport management workflow for AutoCAD and Civil 3D drawings. 🔒 Users can protect viewport scales, control annotation visibility, and synchronize zoom views across many sheets from one dialog. ✅ LayoutTools improves plan set cleanup, plotting consistency, sheet navigation, and production drawing review. Important Notes ⚠️ The tool changes viewport locks, ANNOALLVISIBLE values, and view state in the active drawing. ⚠️ Zoom Window requires point selection after the dialog closes, so the routine temporarily exits the DCL before applying the window to multiple layouts. ⚠️ Layouts without usable viewports may be skipped depending on the active options. ⚠️ The zoom status is tracked by this tool and may show Z? for layouts without stored status. ⚠️ Always confirm the selected scope before applying Lock, Unlock, AnnON, AnnOFF, or Zoom actions to many layouts. Tags 🏷️ AutoCAD, 🏷️ Civil 3D, 🏷️ AutoLISP, 🏷️ Visual LISP, 🏷️ DCL dialog, 🏷️ CAD automation, 🏷️ CAD productivity, 🏷️ Layout tools, 🏷️ Viewport lock, 🏷️ Unlock viewports, 🏷️ ANNOALLVISIBLE, 🏷️ Zoom Extents, 🏷️ Zoom Window, 🏷️ Paper space, 🏷️ Layout QA, 🏷️ Sheet cleanup, 🏷️ Viewport management, 🏷️ Named Object Dictionary, 🏷️ XRECORD