Function Syntax: GoToLayout Version: 1.1 Date: 20.06.2026 6:38:55PM AI+https://forums.augi.com/showthread.php?69541-A-way-to-select-a-layout-tab-with-a-lisp Summary This program provides an interactive way to find and switch to drawing layouts using wildcard filters, through a temporary DCL dialog generated at runtime. How the user runs it Type GOTOLAYOUT at the AutoCAD command line to open the dialog. What the user does in the dialog • Enter a layout name filter using wildcards and ? (example: A, SHEET??). • Review matching layouts in a list (the list includes Model). • Optionally enable Preview switch while browsing to switch tabs as you move through the list. • Use Next and Prev to cycle through matches (wrap-around navigation). • Click OK to commit the selected layout, or Cancel to revert to the original tab. Functionalities • Filters layouts using wildcard matching via wcmatch with * and ? patterns. • Preserves original layout name casing for display and for switching tabs (no forced uppercase for the actual layout names). • Sorts matching results alphabetically in a case-insensitive manner for predictable browsing. • Disables OK and disables navigation when there are zero matches, preventing invalid layout switches. • Remembers the last used filter pattern (it reappears the next time you run the command). • Supports optional live switching using Preview, so users can visually confirm they are on the intended sheet before committing. Important behaviors to recognize • The active tab is changed by setting CTAB to the selected layout name. • If the user cancels, the program restores the original CTAB (even if preview switching was used). • If the filter is empty, it is treated as * (meaning all layouts match). Temporary files and cleanup • The dialog is created by writing a temporary .dcl file with a unique name each run (generated with vl-filename-mktemp). • The temporary .dcl file is deleted after the dialog closes, whether the user clicks OK or Cancel. Description 📑 GoToLayout is an AutoCAD and Civil 3D AutoLISP navigation utility for quickly switching to layout tabs through a filtered DCL dialog. 🔍 It supports wildcard layout searches, preview switching while browsing, Previous and Next navigation, and cancel-safe restoration of the original tab. Function Syntax 🚀 Main dialog command: GoToLayout 🧰 Load the LSP with APPLOAD and run the command in AutoCAD or Civil 3D. SEO Optimized Overview 📑 GoToLayout is an SEO-friendly AutoCAD layout navigation tool for drawings with many paper-space tabs. 🔍 The routine dynamically creates a Go To Layout DCL dialog with a wildcard layout-name filter, a match counter, a list of matching tabs, and Previous and Next buttons. 👁️ The Preview switch can update CTAB while the user browses the results, making it easier to visually inspect layout tabs before choosing the final destination. 🧠 The last used filter pattern is remembered across command runs through the global variable *gtl:lastpat*. 🛡️ If the dialog is cancelled, the routine restores the original layout tab so accidental browsing does not leave the drawing on the wrong sheet. 📌 This is useful for Civil 3D plan sets, DWG files with many layouts, sheet navigation, plotting preparation, and layout quality-control checks. Primary Workflow 1️⃣ Load GoToLayout into AutoCAD or Civil 3D with APPLOAD. 2️⃣ Run GoToLayout 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 ✅ Open a compact DCL dialog for fast layout-tab navigation. ✅ Filter layout names with wildcard patterns using * and ?. ✅ Include Model together with paper-space layouts in the searchable list. ✅ Sort matched layouts case-insensitively. ✅ Preview matched tabs by switching CTAB while browsing. ✅ Move through filtered matches with Previous and Next buttons. ✅ Confirm a layout with OK and switch to it. ✅ Restore the original CTAB when the user cancels the dialog. ✅ Remember the last search pattern for repeated use. Important Commands and Helper Functions 🧩 _gtl:temp-dcl-path creates a unique temporary DCL file path for each run. 🧩 _gtl:write-dcl writes the Go To Layout dialog definition at runtime. 🧩 _gtl:layouts-raw collects Model plus all layout names for browsing. 🧩 _gtl:sort-ci sorts layout names case-insensitively. 🧩 _gtl:filter-layouts applies wildcard filtering to layout names. 🧩 _gtl:fill-list repopulates the DCL list box. 🧩 gtl:update rebuilds the matches list, updates the counter, and manages OK and navigation button states. 🧩 gtl:on-list, gtl:prev, and gtl:next handle direct selection and cyclic navigation. 🧩 gtl:_set-ctab-if-preview switches the active tab when preview mode is enabled. Practical Result 🎯 The result is faster navigation through drawings with many layout tabs. 📑 Users can search for layout names, preview tabs, and jump directly to the needed sheet without manually scrolling along the layout tab bar. ✅ GoToLayout improves production navigation, sheet review, plotting preparation, and quality-control workflows in AutoCAD and Civil 3D drawings. Important Notes ⚠️ Preview mode temporarily changes CTAB while browsing; Cancel restores the original tab. ⚠️ Empty filters are treated as * so all layouts are listed. ⚠️ The temporary DCL file is deleted after the dialog closes. ⚠️ The last filter is stored only as a session/global variable, not as a persistent external settings file. Tags 🏷️ AutoCAD, 🏷️ Civil 3D, 🏷️ AutoLISP, 🏷️ Visual LISP, 🏷️ DCL dialog, 🏷️ CAD automation, 🏷️ CAD productivity, 🏷️ Layout navigation, 🏷️ Go to layout, 🏷️ Layout filter, 🏷️ Wildcard search, 🏷️ Paper space, 🏷️ CTAB, 🏷️ Sheet navigation, 🏷️ Layout preview, 🏷️ Plan set, 🏷️ Drawing review Function Syntax: GoToLayout AI+https://forums.augi.com/showthread.php?69541-A-way-to-select-a-layout-tab-with-a-lisp Summary This program provides an interactive way to find and switch to drawing layouts using wildcard filters, through a temporary DCL dialog generated at runtime. How the user runs it Type GOTOLAYOUT at the AutoCAD command line to open the dialog. What the user does in the dialog • Enter a layout name filter using wildcards and ? (example: A, SHEET??). • Review matching layouts in a list (the list includes Model). • Optionally enable Preview switch while browsing to switch tabs as you move through the list. • Use Next and Prev to cycle through matches (wrap-around navigation). • Click OK to commit the selected layout, or Cancel to revert to the original tab. Functionalities • Filters layouts using wildcard matching via wcmatch with * and ? patterns. • Preserves original layout name casing for display and for switching tabs (no forced uppercase for the actual layout names). • Sorts matching results alphabetically in a case-insensitive manner for predictable browsing. • Disables OK and disables navigation when there are zero matches, preventing invalid layout switches. • Remembers the last used filter pattern (it reappears the next time you run the command). • Supports optional live switching using Preview, so users can visually confirm they are on the intended sheet before committing. Important behaviors to recognize • The active tab is changed by setting CTAB to the selected layout name. • If the user cancels, the program restores the original CTAB (even if preview switching was used). • If the filter is empty, it is treated as * (meaning all layouts match). Temporary files and cleanup • The dialog is created by writing a temporary .dcl file with a unique name each run (generated with vl-filename-mktemp). • The temporary .dcl file is deleted after the dialog closes, whether the user clicks OK or Cancel. Description 📑 GoToLayout is an AutoCAD and Civil 3D AutoLISP navigation utility for quickly switching to layout tabs through a filtered DCL dialog. 🔍 It supports wildcard layout searches, preview switching while browsing, Previous and Next navigation, and cancel-safe restoration of the original tab. Function Syntax 🚀 Main dialog command: GoToLayout 🧰 Load the LSP with APPLOAD and run the command in AutoCAD or Civil 3D. SEO Optimized Overview 📑 GoToLayout is an SEO-friendly AutoCAD layout navigation tool for drawings with many paper-space tabs. 🔍 The routine dynamically creates a Go To Layout DCL dialog with a wildcard layout-name filter, a match counter, a list of matching tabs, and Previous and Next buttons. 👁️ The Preview switch can update CTAB while the user browses the results, making it easier to visually inspect layout tabs before choosing the final destination. 🧠 The last used filter pattern is remembered across command runs through the global variable *gtl:lastpat*. 🛡️ If the dialog is cancelled, the routine restores the original layout tab so accidental browsing does not leave the drawing on the wrong sheet. 📌 This is useful for Civil 3D plan sets, DWG files with many layouts, sheet navigation, plotting preparation, and layout quality-control checks. Primary Workflow 1️⃣ Load GoToLayout into AutoCAD or Civil 3D with APPLOAD. 2️⃣ Run GoToLayout 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 ✅ Open a compact DCL dialog for fast layout-tab navigation. ✅ Filter layout names with wildcard patterns using * and ?. ✅ Include Model together with paper-space layouts in the searchable list. ✅ Sort matched layouts case-insensitively. ✅ Preview matched tabs by switching CTAB while browsing. ✅ Move through filtered matches with Previous and Next buttons. ✅ Confirm a layout with OK and switch to it. ✅ Restore the original CTAB when the user cancels the dialog. ✅ Remember the last search pattern for repeated use. Important Commands and Helper Functions 🧩 _gtl:temp-dcl-path creates a unique temporary DCL file path for each run. 🧩 _gtl:write-dcl writes the Go To Layout dialog definition at runtime. 🧩 _gtl:layouts-raw collects Model plus all layout names for browsing. 🧩 _gtl:sort-ci sorts layout names case-insensitively. 🧩 _gtl:filter-layouts applies wildcard filtering to layout names. 🧩 _gtl:fill-list repopulates the DCL list box. 🧩 gtl:update rebuilds the matches list, updates the counter, and manages OK and navigation button states. 🧩 gtl:on-list, gtl:prev, and gtl:next handle direct selection and cyclic navigation. 🧩 gtl:_set-ctab-if-preview switches the active tab when preview mode is enabled. Practical Result 🎯 The result is faster navigation through drawings with many layout tabs. 📑 Users can search for layout names, preview tabs, and jump directly to the needed sheet without manually scrolling along the layout tab bar. ✅ GoToLayout improves production navigation, sheet review, plotting preparation, and quality-control workflows in AutoCAD and Civil 3D drawings. Important Notes ⚠️ Preview mode temporarily changes CTAB while browsing; Cancel restores the original tab. ⚠️ Empty filters are treated as * so all layouts are listed. ⚠️ The temporary DCL file is deleted after the dialog closes. ⚠️ The last filter is stored only as a session/global variable, not as a persistent external settings file. Tags 🏷️ AutoCAD, 🏷️ Civil 3D, 🏷️ AutoLISP, 🏷️ Visual LISP, 🏷️ DCL dialog, 🏷️ CAD automation, 🏷️ CAD productivity, 🏷️ Layout navigation, 🏷️ Go to layout, 🏷️ Layout filter, 🏷️ Wildcard search, 🏷️ Paper space, 🏷️ CTAB, 🏷️ Sheet navigation, 🏷️ Layout preview, 🏷️ Plan set, 🏷️ Drawing review