Function Syntax: Command Version: 1 Date: 23.12.2025 AI Summary Description This program provides a layer-selection dialog and a zoom-to-layer command for AutoCAD. Primary command: Zoom2Layer (runs the workflow end to end). What the user will do 1. Run the command Zoom2Layer. 2. In the dialog, choose a target layer from a filtered list (visible and unfrozen layers only). 3. Optionally, press Pick Layer from Drawing and select an object in the drawing to auto-set the target layer. 4. Click OK to zoom to all objects found on that layer, or Cancel to exit. Dialog and selection behavior Filter field: Supports wildcard patterns using and ? to narrow the list of layers. Layer list contents: Only layers that are not Off and not Frozen are displayed. Default behavior: If the filter is empty, it is treated as . If the filtered list is not empty, the first item is selected by default. Pick from drawing: Selecting an object reads its layer (DXF group 8) and uses that layer name as the current filter target. Persistence: The last-used filter is saved to the environment variable CHLAY-LAST-FILTER and restored on the next run. Zoom operation Selection set: The program gathers all entities on the chosen layer using a global selection (equivalent to selecting the entire drawing filtered by layer). Extents calculation: It computes a combined bounding window by iterating entities that support GetBoundingBox and expanding the min and max corners. Zoom execution: It zooms to the computed window using ZoomWindow. Functionalities (bullet list) Layer picker dialog with searchable filtering using wildcard patterns. • Lists only visible and unfrozen layers for practical selection. Pick Layer from Drawing to capture a layer name directly from a selected object. • Remembers the last filter via CHLAY-LAST-FILTER to speed up repeated use. • Finds all objects on the selected layer and zooms to their combined extents. Outputs and edge cases • If the user cancels or selects nothing, the command ends with the message No layer selected or cancelled. • If no objects exist on the chosen layer, it reports No objects found on layer. • If objects exist but none provide valid geometry for bounding boxes, it reports No valid geometry to zoom to.