Function Syntax: LayerFilterFreezeThawOnPlotVPFreeze Version: 1.1 Date: 20.06.2026 6:38:54PM N/A Program name and command This LISP loads a DCL dialog named LFM for managing layer filters and applying layer actions in bulk. Primary command entry point is LFM style workflow implemented by the function c:LayerFilterFreezeThawOnPlotVPFreeze. What the user must do User runs the command, then: • Selects a layer filter from the dropdown list. • Chooses one or more actions via checkboxes. • Optionally enables Invert filter to apply actions to all layers except those in the selected filter. • Clicks Apply to execute, or Cancel to exit. Special case for viewport actions: • If VP Freeze or VP Thaw is selected, the program will prompt the user to select a floating paper space viewport before applying viewport-specific layer changes. Dialog layout and controls Dialog title is Layer Filters and includes: • Filter dropdown list: key flt. • Action toggles grouped in Standard Actions: • Freeze group: FRZ Freeze, THW Thaw. • On Off group: ON On, OFF Off. • Lock group: LCK Lock, ULK Unlock. • Plot group: PLT Plot, NPL No Plot. • Viewport group: VPF VP Freeze, VPT VP Thaw. • Invert toggle: key invert with label Invert filter apply to all except selected. • Info text: key info shows selected filter name and estimated layer count. • Buttons: Check All, Check None, Apply, Cancel. FunctionalitiesReads AutoCAD layer filters from the layers extension dictionary entry ACAD_LAYERFILTERS and lists available filter names in the dialog.Resolves the selected filter to an XRECORD and extracts layer membership by parsing stored strings and wildcard patterns.Supports wildcard based layer matching using patterns containing star, question mark, or bracket expressions and expands them against all drawing layers.Supports invert mode to target all layers not included in the selected filter.Applies bulk layer actions to the computed layer list.Remembers last settings including last chosen filter index, invert flag, and all toggle states for the next run.Enforces mutual exclusivity in each action pair so contradictory options cannot be checked together, for example Freeze versus Thaw, On versus Off, Lock versus Unlock, Plot versus No Plot, VP Freeze versus VP Thaw.Provides quick presets via Check All and Check None. Actions applied to layers The program issues AutoCAD layer operations primarily through the command line interface _.-LAYER and through ActiveX where available. • Freeze: FRZ uses _.-LAYER _F for each target layer. • Safety behavior: the current layer from CLAYER is skipped for Freeze to avoid freezing the active layer. • Thaw: THW uses _.-LAYER _T for each target layer. • On: ON uses _.-LAYER _ON for each target layer. • Off: OFF uses _.-LAYER _OFF for each target layer. • Lock: LCK uses _.-LAYER _LO for each target layer. • Unlock: ULK uses _.-LAYER _UN for each target layer. • Plot or No Plot: • Primary method uses ActiveX property update: vla-put-Plottable. • Fallback method uses layer command: _.-LAYER _P _Y or _.-LAYER _P _N if ActiveX fails. Viewport Freeze and Thaw behavior Viewport actions are implemented using an ACAD XDATA method and apply only after the user selects a valid viewport entity. Viewport selection rules: • The selected entity must be a VIEWPORT and must be a floating viewport, identified by viewport number greater than 1. If the selection is invalid: • The routine prints an error indicating no viewport was selected or it was not a floating viewport, and counts those operations as skipped. Viewport lock handling: • If the viewport is locked, the routine temporarily unlocks it using vla-put-DisplayLocked, performs the XDATA operations, then restores the original lock state. VP Freeze operation: • For each target layer, it writes a 1003 string entry into the viewport ACAD XDATA list, effectively registering the layer as frozen for that viewport. VP Thaw operation: • For each target layer, it scans the viewport ACAD XDATA and removes any matching 1003 layer name entries. Viewport refresh: • After VP operations, it forces a viewport display refresh by toggling display off then on via vla-display calls. Filter parsing and layer resolution logic • The routine extracts filter definitions from XRECORD content by collecting all string values and tokenizing them into candidate layer names, then matching those tokens against existing layers. • It also extracts wildcard patterns from XRECORD strings and expands them using wcmatch against all layer names. • When a filter root resolves to a dictionary, it may contain multiple XRECORDs; the routine selects an XRECORD using the chosen filter index, and if that yields zero layers it automatically picks the XRECORD with the highest resolved layer count. Execution flow and outputs • After Apply, the routine prints a summary to the command line showing filter name, number of layers in the filter, whether invert is enabled, how many layers are processed, and the action codes selected. • It then applies the chosen actions and prints totals: issued actions count and skipped count. • At the end it triggers REGENALL to refresh the drawing display after changes. Cancel and cleanup behavior • The dialog Cancel button ends the dialog and prints Cancelled. • Temporary DCL is written to a temp file and is deleted after dialog use. • The routine includes a hard cancel helper lf:hardCancel which sends ENTER and ESC sequences to terminate active commands because the build does not support the AutoCAD CANCEL command. Description ❄️ LayerFilterFreezeThaw is an AutoCAD DCL layer filter manager for applying Freeze, Thaw, On, Off, Lock, and Unlock actions to predefined layer sets. 🚆 It includes a dedicated Kable filter with 30 exact railway or utility layer names plus quick commands for normal and inverted actions. Function Syntax 🚀 Main dialog command: LFM ⚡ Quick Kable commands: FKABLE, TKABLE, OKABLE, XFABLE, FKABLEI, TKABLEI 🧪 Verification command: VERIFYKABLE 🧰 Helper command: LFM-Kable SEO Optimized Overview ❄️ LayerFilterFreezeThaw is an SEO-friendly AutoCAD layer filter action tool for applying layer state changes to predefined layer groups. 🧱 The DCL dialog presents a filter list and radio-button action set, allowing the user to freeze, thaw, turn on, turn off, lock, or unlock matching layers. 🚆 The Kable filter contains 30 exact layer names for Hartingstecker, 30 kV K1 and K2, OSE, Ortsnetz, and 750 V layer groups, making the routine highly targeted for repeated project standards. 🔁 The invert option applies the chosen action to all layers except the selected filter, supporting quick isolation workflows. 📌 This is useful for Civil 3D production drawings, railway electrical layers, project layer visibility control, quick cable-layer isolation, and CAD layer cleanup. Primary Workflow 1️⃣ Load the AutoLISP file in AutoCAD or Civil 3D with APPLOAD or your menu loader. 2️⃣ Run the command shown above from the AutoCAD command line. 3️⃣ Follow the dialog, selection prompts, or file prompts used by LayerFilterFreezeThaw. 4️⃣ Review the command-line report and drawing result before continuing production work. Functionalities ✅ Select a predefined layer filter from a DCL popup. ✅ Apply Freeze, Thaw, On, Off, Lock, or Unlock. ✅ Invert the selected filter to process all layers except the chosen group. ✅ Use quick commands for Kable freeze, thaw, on, off, and inverted variants. ✅ Verify whether the expected Kable layer list exists in the drawing. ✅ Print action-by-action feedback and final changed/skipped counts. ✅ Regenerate the drawing after successful layer state changes. Important Functions and AutoCAD API 🧩 _lf:DclText builds the Layer Filters dialog as embedded DCL text. 🧩 _lf:GetAllFilterNames returns the available standard filter names. 🧩 _lf:GetLayersByFilter resolves filter names to actual layer names or hardcoded project layer sets. 🧩 _lf:SetLayerState applies Freeze, Thaw, On, Off, Lock, or Unlock to one layer object. 🧩 _lf:ApplyToLayerNames processes the layer list and reports changed versus skipped layers. 🧩 LFM-Kable provides command-line shortcut execution for the Kable group. 🧩 VERIFYKABLE checks whether all 30 Kable layers exist in the current drawing. Result 🎯 The result is a controlled layer-state update for a chosen filter group or its inverse. 🟢 The tool saves time when repeatedly isolating, hiding, thawing, or locking known project layer groups. Operational Notes and Limitations ⚠️ The Kable filter is hardcoded to exact layer names; missing layers are skipped and can be checked with VERIFYKABLE. ⚠️ The command changes layer state properties in the active drawing. 🧠 Use the inverted mode carefully because it affects all layers outside the selected filter. Tags 🏷️ AutoCAD, 🏷️ AutoLISP, 🏷️ Civil 3D, 🏷️ Layer Filters, 🏷️ Freeze Thaw, 🏷️ Kable Layers, 🏷️ Railway CAD, 🏷️ DCL Dialog, 🏷️ Layer Visibility