Function Syntax: Layouts_list Version: 2 Date: 24.12.2025 AI+https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/retrieve-layout-names-by-order-of-which-they-sit-to-populate-in/td-p/10117384 All_Layouts_List (AutoLISP) Description This program opens a dialog that lists all drawing layouts in tab order, lets the user filter and multi-select them, and copies the selected layout names to the Windows clipboard (one name per line). How the user runs it • Run either command: ALL_LAYOUTS_LIST or All_Layouts_list. • A dialog titled All Layouts List appears. What the user does in the dialog • Optionally type a wildcard pattern in Filter (supports * and ?). • Click Apply to rebuild the visible list using the filter. • Toggle Include Model to decide whether the MODEL layout is included in the list. • Multi-select layouts in the list box (the Selected counter updates). • Use Select All or Select None to quickly change selection. • Click Copy to Clipboard to copy selected layout names (one per line). • Press OK to close, or Cancel to close without any special return value. FunctionalitiesLayout collection: Reads all layouts from the active drawing and sorts them by TabOrder so the dialog list matches the layout tab sequence.Filtering: Applies wildcard matching to layout names using the user filter (default is * which shows everything).Model inclusion control: When Include Model is off, the layout named MODEL is excluded from the list.Multi-selection: The list supports multi-select, and a live Selected count is displayed.Selection utilities: Select All selects every displayed item; Select None clears selection.Copy output: Copy to Clipboard sends the selected layout names to the Windows clipboard, separated by line breaks (one per line).Selection preservation on rebuild: When the list is rebuilt (Apply or Include Model change), the program tries to reselect previously selected items by name, as long as they still exist in the filtered list. Important program behaviors • The dialog definition (DCL) is embedded and written to a temporary file each run, with a unique dialog name generated from the drawing date variable so repeated runs do not collide. • Clipboard copy uses two strategies: • First attempt: MSHTML clipboardData setdata. • Fallback: write text to a temp file then call PowerShell Set-Clipboard and also attempt clip.exe as an additional fallback path. • If the user clicks copy with no selection, the dialog message shows Nothing selected and an alert prompts the user to select one or more layouts. Key internal functionsALLLAY:Run: Main routine that builds the layout list, writes and loads the DCL, wires UI actions, and shows the dialog.ALLLAY:rebuild: Recomputes the displayed list based on filter and Include Model, then repopulates the list box.ALLLAY:get-selected-names: Converts selected list indexes into layout name strings.ALLLAY:copy-selected: Builds the clipboard payload (names separated by CRLF) and calls the clipboard function.ALLLAY:copy-clipboard: Performs the clipboard write using MSHTML first, then PowerShell and clip.exe fallback.ALLLAY:cleanup: Unloads the dialog and deletes the temporary DCL file.error: Ensures cleanup on unexpected errors, suppressing normal cancel and break messages. Outputs • Primary output: layout names copied into the Windows clipboard, one per line, suitable for pasting into text, spreadsheets, or CAD documentation. • On-screen feedback: message field shows count copied (for example 3 copied) after a successful copy.