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.
zoomwindow 000

Command:

Command
  • LZW Runs Zoom Window on selected layouts in Paper Space.

Description:

User workflow
  • Run LZW.
  • Select one or more Layouts from the list.
  • Optional filter using wildcards * and ?.
  • Optional toggle Include Model to show MODEL in the list.
  • Optional Copy to Clipboard to copy selected layout names and status.
  • Trigger Zoom Window, the dialog closes, then pick two corners for the window, and the same window is applied to each selected layout tab.
  • If point picking is cancelled, the routine cancels the action and restores the original tab.
Execution context The routine forces MSpace false so the zoom happens in Paper Space rather than inside a viewport.

Helper function: (if any)​

Helper functions and mechanisms
  • GetLayouts reads available layouts using layoutlist.
  • FilterLayouts applies wildcard filtering using wcmatch and optional Model inclusion.
  • WriteDCL builds a temporary DCL file with a unique dialog name per run.
  • CopyClipboard copies text via htmlfile clipboardData with PowerShell and clip fallback.
  • ZoomWindowLayouts asks for one window then iterates CTAB across layouts and applies the same window with COM then command fallback.
  • Cleanup unloads the dialog and deletes the temporary DCL file.

Functionalities:

Functionalities
  • Dialog UI for filtering and multi-selecting layouts.
  • Select All and Select None selection tools and selected count display.
  • Clipboard export of selected layout names and status.
  • Zoom Window in Paper Space across the selected layouts using one picked window applied consistently.
  • Undo grouping for multi-layout operations using StartUndoMark and EndUndoMark.
  • Robust fallbacks for temp DCL creation and zoom execution.

Result:

Result After selection in the dialog, LZW prompts for a zoom window once, then switches through the chosen layout tabs and applies Zoom Window in Paper Space, restoring the original tab when finished. Tags CAD, General_AutoCAD, Extra_AutoCAD, Lisp, Layouts, Paper Space, Viewports, DCL, Dialog_UI, Clipboard Suggest relevant tags not in the list Zoom, Wildcards, Undo, Selection_UI, Temp_File_Handling

Images, animations etc.

zoomwindow 000
Pixel

XAML code:

<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows">
    
    <src:RibbonToolTip x:Key="Zoom Window">
        <src:RibbonToolTip.ExpandedContent>
            <StackPanel>
                <TextBlock Background="AntiqueWhite" TextAlignment="Left">
				<Bold>Function Syntax: LZW</Bold>
				<LineBreak/>
				<Hyperlink>AI+https://www.cadtutor.net/forum/topic/41748-zoom-extend-all-layouts/</Hyperlink>
				<LineBreak/>
<Bold>Version: 2 Date: 29.12.2025</Bold>
<LineBreak/>
				<LineBreak/>		

<Bold>LZW description</Bold><LineBreak/>
This program requires the user to select one or more <Run Foreground="DarkRed">Layouts</Run> from a <Run Foreground="DarkRed">DCL dialog</Run>, then it prompts the user to pick a window and applies <Run Foreground="DarkRed">Zoom Window</Run> in <Run Foreground="DarkRed">Paper Space</Run> on each selected layout after the dialog closes.<LineBreak/>

<Bold>LZW command</Bold><LineBreak/>
• <Run Foreground="DarkRed">LZW</Run> runs <Run Foreground="DarkRed">Zoom Window</Run> on selected layouts in <Run Foreground="DarkRed">Paper Space</Run>.<LineBreak/>

<Bold>LZW user workflow</Bold><LineBreak/>
• Run <Run Foreground="DarkRed">LZW</Run>.<LineBreak/>
• A <Run Foreground="DarkRed">DCL dialog</Run> opens with a multi-select list of <Run Foreground="DarkRed">Layouts</Run>.<LineBreak/>
• Optional toggle <Run Foreground="DarkRed">Include Model</Run> controls whether <Run Foreground="DarkRed">MODEL</Run> appears in the list.<LineBreak/>
• Filter layouts with wildcards <Run Foreground="DarkRed">*</Run> and <Run Foreground="DarkRed">?</Run>, then multi-select the target layouts.<LineBreak/>
• Use <Run Foreground="DarkRed">Select All</Run> or <Run Foreground="DarkRed">Select None</Run> to manage selection quickly.<LineBreak/>
• Optional action <Run Foreground="DarkRed">Copy to Clipboard</Run> copies selected layout names and their status.<LineBreak/>
• Trigger the zoom action, the dialog closes, and the program prompts for two corners to define the zoom window.<LineBreak/>
• If the user cancels point picking, the routine cancels the action and restores the previous tab.<LineBreak/>

<Bold>LZW functionalities</Bold><LineBreak/>
• <Run Foreground="DarkRed">Dialog UI</Run> for filtering and multi-selecting layouts.<LineBreak/>
• <Run Foreground="DarkRed">Layout filtering</Run> using <Run Foreground="DarkRed">wcmatch</Run> with wildcard patterns.<LineBreak/>
• <Run Foreground="DarkRed">Selection tools</Run> including Select All, Select None, and selected count display.<LineBreak/>
• <Run Foreground="DarkRed">Clipboard export</Run> using MSHTML clipboardData with fallback to PowerShell Set-Clipboard and cmd clip.<LineBreak/>
• <Run Foreground="DarkRed">Stable execution</Run> by running zoom after the dialog closes.<LineBreak/>
• <Run Foreground="DarkRed">Undo grouping</Run> using StartUndoMark and EndUndoMark for clean undo.<LineBreak/>
• <Run Foreground="DarkRed">Temporary DCL creation</Run> with mktemp and fallback pathing, followed by cleanup.<LineBreak/>

<Bold>LZW zoom behavior</Bold><LineBreak/>
• Switches to the first selected layout before prompting so the user sees the correct context.<LineBreak/>
• Prompts for window corners using <Run Foreground="DarkRed">getpoint</Run> and <Run Foreground="DarkRed">getcorner</Run> once, then reuses the same window for all selected layouts.<LineBreak/>
• Iterates selected layouts by switching <Run Foreground="DarkRed">CTAB</Run> for each layout and applies the same zoom window.<LineBreak/>
• Forces <Run Foreground="DarkRed">MSpace false</Run> so zoom occurs in <Run Foreground="DarkRed">Paper Space</Run> rather than inside a viewport.<LineBreak/>
• Attempts COM zoom first using <Run Foreground="DarkRed">vla-ZoomWindow</Run> and falls back to <Run Foreground="DarkRed">ZOOM W</Run> if COM fails.<LineBreak/>
• Restores the previous <Run Foreground="DarkRed">CTAB</Run> after processing all layouts.<LineBreak/>

<Bold>LZW safeguards and cleanup</Bold><LineBreak/>
• Ensures layouts are enabled by setting <Run Foreground="DarkRed">TILEMODE</Run> to 0 when needed.<LineBreak/>
• Uses an error handler to guarantee dialog unload and temporary DCL deletion on cancel or error.<LineBreak/>
• Excludes <Run Foreground="DarkRed">MODEL</Run> from execution unless explicitly included and valid for the action.<LineBreak/>


 
</TextBlock>
                
                <!-- Use MediaElement for GIF (static first frame) and Image as fallback -->





            </StackPanel>
        </src:RibbonToolTip.ExpandedContent>
    </src:RibbonToolTip>
</ResourceDictionary>

Additional info:

Share this page:

Leave a Reply

Page Tag: 🏷️ General_AutoCAD

  • 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…

  • Layouts_list

    Short description Shows a DCL dialog listing all layouts with wildcard filtering and multi-select, then copies the selected layout names to the Windows clipboard (one per line). Includes optional Model tab inclusion, selection count display, and Select All or Select None shortcuts. Command: Commands: ALL_LAYOUTS_LIST, All_Layouts_list Description: Collects layout names from the active drawing using…

  • 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…

  • SteSysVar

    Short description Tabbed “system variables tuner” for AutoCAD that lets you set common SYSVARs from dropdowns instead of typing SETVAR. Builds its own DCL with tabs (File, Dialogs, Drawing Behavior, Selection, Drafting Aids, Xrefs, Publish) and applies all chosen values at once. Command: Command: c:SteSysVar Opens the main tabbed dialog starting on the “File” tab,…

  • SetPlotDeviceNames_00

    Short description SetPlotDeviceNames — set every layout’s plot device to DWG To PDF.pc3 when available Iterates all layouts, refreshes device info, validates availability, then assigns the plot configuration Prints a warning per layout when the target device is not present Command: • SetPlotDeviceNames Description: Loads COM and targets a single plot configuration name: DWG To…

  • Hide / Show Objects

    Short description Provides a dialog box for controlling object visibility in AutoCAD. Lets you choose between isolating, hiding, or displaying all objects using radio buttons and confirmation controls. Command: Command: c:HS Opens the “Display Objects Options” dialog where you can select whether to isolate selected objects, hide them, or show all objects again. Description: When…

  • 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:…