SelectCreateLayerFilter

Short description

πŸ”Ž SelectCreateLayerFilter is an AutoCAD and Civil 3D AutoLISP tool that builds a layer Properties Filter from the layers found in a selected set of drawing objects.
🧰 It adds a practical DCL interface for naming the filter, choosing the parent filter, filtering layer names with wildcards, selecting layers, copying the expression, and applying the result directly through the AutoCAD LAYER filter command.

Command:

πŸš€ Main command: SelectCreateLayerFilter
⚑ Alias command: SCLF
🧰 Workflow: select drawing entities, review their unique layers in the dialog, filter names with * and ?, select the layers to include, then apply the generated AutoCAD layer filter expression.

Description:

πŸ”Ž SelectCreateLayerFilter is an SEO-friendly AutoCAD layer filter generator for drawings with many layers, xrefs, discipline layers, and Civil 3D production standards.
🧩 The command starts by prompting the user to select entities, extracts their layer names from DXF group code 8, removes duplicates, and uses those names as the source list for a layer Properties Filter.
πŸŽ›οΈ The temporary DCL dialog provides filter name, parent filter, wildcard layer filtering, multi-select layer control, horizontal scrolling for long layer names, Select All, Select None, Undo, Copy Expression, Copy Layers, Debug, Apply, and Cancel.
πŸ“‹ The generated expression uses AutoCAD-style layer filter syntax such as NAME==”LayerName” OR NAME==”OtherLayer”.
πŸ—οΈ This is useful for AutoCAD and Civil 3D layer management, xref layer cleanup, project layer grouping, discipline filtering, QA review, and fast creation of custom layer filters from selected model-space objects.

Helper function: (if any)​

🧩 _pf:GetLayersFromSS reads the user selection set and returns the unique layer names used by the selected entities.
🧩 _pf:BuildLayerExpr converts selected layer names into an AutoCAD layer filter expression using NAME==”…” and OR conditions.
🧩 _pf:FilterByPattern applies wildcard filtering with wcmatch, supporting * and ? patterns for fast layer-name searches.
🧩 _pf:CopyToClipboard copies generated expressions, layer lists, and debug information to the Windows clipboard through an htmlfile COM object.
🧩 _pf:StoreSettings and _pf:LoadSettings save and restore the last filter name, parent filter, and dialog-position values under HKEY_CURRENT_USER\Software\LayerFilterPlus.
🧩 Runtime DCL generation creates the Layer Filter Builder dialog as a temporary file, loads it, unloads it, and deletes it during cleanup.
🧩 The SCLF alias calls the full SelectCreateLayerFilter command for faster command-line access.

Functionalities:

βœ… πŸ”Ž Creates an AutoCAD Properties Filter from layers extracted from selected entities.
βœ… 🧱 Removes duplicate layer names before presenting the layer list.
βœ… πŸŽ›οΈ Provides a custom DCL dialog for filter name, parent filter, pattern search, multi-selection, and confirmation.
βœ… πŸ” Supports wildcard layer filtering with * and ? characters.
βœ… ↔️ Includes a horizontal scroll slider so very long layer names remain readable in the dialog.
βœ… πŸ“‹ Copies the generated layer-filter expression to the clipboard for review or reuse.
βœ… πŸ“‹ Copies selected layer names to the clipboard as a line-by-line list.
βœ… πŸ§ͺ Provides a Debug button that copies the current filter name, parent filter, selected layers, pattern, and expression.
βœ… πŸ’Ύ Remembers last-used settings in the Windows registry.
βœ… 🧰 Runs the AutoCAD -LAYER FILTER workflow automatically after the user clicks Apply.

Result:

🎯 The result is a faster, selection-based layer filter workflow for AutoCAD and Civil 3D drawings.
πŸ“Œ Instead of manually typing long layer names into the Layer Properties Manager, the user can select representative objects and generate a clean filter expression from their layers.
🧭 This improves layer navigation, xref review, CAD standard checks, discipline-specific filtering, and project drawing cleanup in production environments.

Images, animations etc.

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="SelectCreateLayerFilter">
<src:RibbonToolTip.ExpandedContent>
<StackPanel>
<TextBlock Background="AntiqueWhite" TextAlignment="Left">
<Bold>Function Syntax: SelectCreateLayerFilter / SCLF</Bold>
<LineBreak/>
<Bold>Version: 1.1 Date: 20.06.2026 6:38:54PM</Bold>
<LineBreak/>
<Hyperlink>N/A</Hyperlink>
<LineBreak/>


<Bold><Run Foreground="DodgerBlue">Description</Run></Bold><LineBreak/>
<Run Foreground="White">🧩 SelectCreateLayerFilter is an AutoCAD and Civil 3D AutoLISP utility designed for faster, cleaner CAD layer and drawing-management workflows.</Run><LineBreak/>
<Run Foreground="LimeGreen">πŸ“Œ It turns the layers of selected AutoCAD objects into a reusable layer Properties Filter with wildcard search, multi-select control, clipboard export, and dialog-based review.</Run><LineBreak/>
<LineBreak/>

<Bold><Run Foreground="DodgerBlue">Function Syntax</Run></Bold><LineBreak/>
<Run Foreground="White">πŸš€ Main command: </Run><Bold><Run Foreground="Orange">SelectCreateLayerFilter</Run></Bold><LineBreak/>
<Run Foreground="White">⚑ Alias command: </Run><Bold><Run Foreground="Orange">SCLF</Run></Bold><LineBreak/>
<LineBreak/>

<Bold><Run Foreground="DodgerBlue">SEO Optimized Overview</Run></Bold><LineBreak/>
<Run Foreground="White">πŸ”Ž This AutoCAD layer filter builder extracts unique layer names from selected entities and converts them into a layer Properties Filter expression.</Run><LineBreak/>
<Run Foreground="White">🧱 The routine reads the entity layer from </Run><Bold><Run Foreground="Orange">DXF group code 8</Run></Bold><Run Foreground="White"> and removes duplicate layer names before opening the dialog.</Run><LineBreak/>
<Run Foreground="White">πŸŽ›οΈ The dialog supports filter name, parent filter, wildcard pattern search, multi-select layer selection, horizontal scrolling, Select All, Select None, Undo, Copy Expression, Copy Layers, and Debug.</Run><LineBreak/>
<Run Foreground="White">πŸ“‹ The generated expression uses syntax like </Run><Bold><Run Foreground="Orange">NAME==&quot;LayerName&quot; OR NAME==&quot;OtherLayer&quot;</Run></Bold><Run Foreground="White"> for AutoCAD layer filter creation.</Run><LineBreak/>
<LineBreak/>

<Bold><Run Foreground="LimeGreen">Primary Workflow</Run></Bold><LineBreak/>
<Run Foreground="White">1️⃣ Run </Run><Bold><Run Foreground="Orange">SCLF</Run></Bold><Run Foreground="White"> or </Run><Bold><Run Foreground="Orange">SelectCreateLayerFilter</Run></Bold><Run Foreground="White">.</Run><LineBreak/>
<Run Foreground="White">2️⃣ Select drawing entities whose layers should become part of the filter.</Run><LineBreak/>
<Run Foreground="White">3️⃣ Enter the filter name and parent filter in the Layer Filter Builder dialog.</Run><LineBreak/>
<Run Foreground="White">4️⃣ Use the </Run><Bold><Run Foreground="DarkRed">Pattern (*,?)</Run></Bold><Run Foreground="White"> field to narrow the visible layer list.</Run><LineBreak/>
<Run Foreground="White">5️⃣ Select the required layers, copy/debug the expression if needed, then click </Run><Bold><Run Foreground="Orange">Apply</Run></Bold><Run Foreground="White">.</Run><LineBreak/>
<LineBreak/>

<Bold><Run Foreground="LimeGreen">Functionalities</Run></Bold><LineBreak/>
<Run Foreground="White">βœ… </Run><Bold><Run Foreground="LimeGreen">Selection-based layer discovery</Run></Bold><Run Foreground="White"> - collects unique layer names from the objects chosen by the user.</Run><LineBreak/>
<Run Foreground="White">βœ… </Run><Bold><Run Foreground="LimeGreen">Layer filter expression creation</Run></Bold><Run Foreground="White"> - builds NAME-based OR expressions for AutoCAD layer filters.</Run><LineBreak/>
<Run Foreground="White">βœ… </Run><Bold><Run Foreground="LimeGreen">Wildcard filtering</Run></Bold><Run Foreground="White"> - supports </Run><Bold><Run Foreground="Orange">*</Run></Bold><Run Foreground="White"> and </Run><Bold><Run Foreground="Orange">?</Run></Bold><Run Foreground="White"> searches in the DCL layer list.</Run><LineBreak/>
<Run Foreground="White">βœ… </Run><Bold><Run Foreground="LimeGreen">Clipboard export</Run></Bold><Run Foreground="White"> - copies either the generated expression or selected layer names for documentation and troubleshooting.</Run><LineBreak/>
<Run Foreground="White">βœ… </Run><Bold><Run Foreground="LimeGreen">Registry persistence</Run></Bold><Run Foreground="White"> - remembers the last filter name and parent filter under </Run><Bold><Run Foreground="Orange">LayerFilterPlus</Run></Bold><Run Foreground="White">.</Run><LineBreak/>
<LineBreak/>

<Bold><Run Foreground="DodgerBlue">Important Commands and Functions</Run></Bold><LineBreak/>
<Run Foreground="White">🧩 </Run><Bold><Run Foreground="Orange">ssget</Run></Bold><Run Foreground="White"> selects the source entities.</Run><LineBreak/>
<Run Foreground="White">🧩 </Run><Bold><Run Foreground="Orange">entget</Run></Bold><Run Foreground="White"> reads object data and layer names.</Run><LineBreak/>
<Run Foreground="White">🧩 </Run><Bold><Run Foreground="Orange">wcmatch</Run></Bold><Run Foreground="White"> performs wildcard matching.</Run><LineBreak/>
<Run Foreground="White">🧩 </Run><Bold><Run Foreground="Orange">-LAYER FILTER</Run></Bold><Run Foreground="White"> creates or updates the AutoCAD layer filter.</Run><LineBreak/>
<Run Foreground="White">🧩 </Run><Bold><Run Foreground="Orange">load_dialog</Run></Bold><Run Foreground="White">, </Run><Bold><Run Foreground="Orange">new_dialog</Run></Bold><Run Foreground="White">, and </Run><Bold><Run Foreground="Orange">action_tile</Run></Bold><Run Foreground="White"> control the DCL interface.</Run><LineBreak/>
<LineBreak/>

<Bold><Run Foreground="DarkRed">Important Notes</Run></Bold><LineBreak/>
<Run Foreground="White">⚠️ The command creates layer filters; it does not move, freeze, delete, or rename entities.</Run><LineBreak/>
<Run Foreground="White">⚠️ Clipboard and registry features depend on Windows and Visual LISP ActiveX support.</Run><LineBreak/>
<Run Foreground="White">⚠️ The temporary DCL file must be writable in the AutoCAD temporary folder.</Run><LineBreak/>
<LineBreak/>

<Bold><Run Foreground="Yellow">Tags</Run></Bold><LineBreak/>
<Run Foreground="Yellow">🏷️ AutoCAD, 🏷️ Civil 3D, 🏷️ AutoLISP, 🏷️ Visual LISP, 🏷️ DCL dialog, 🏷️ Layer filter, 🏷️ Layer properties filter, 🏷️ Layer manager, 🏷️ Layer automation, 🏷️ Wildcard filter, 🏷️ Layer selection, 🏷️ CAD cleanup, 🏷️ CAD standards, 🏷️ Layer naming, 🏷️ Clipboard export, 🏷️ AutoCAD productivity</Run><LineBreak/>



</TextBlock>
            
<Grid>
<Image Source="PNG" Stretch="Uniform"/>
</Grid>
<Grid>
<MediaElement
 Source="GIF"
 Stretch="Uniform"
 Visibility="Visible"/>
 </Grid>
</StackPanel>
</src:RibbonToolTip.ExpandedContent>
</src:RibbonToolTip>
</ResourceDictionary>

Additional info:

Share this page:

Page Tag: 🏷️ Layer selection

  • SelectCreateLayerFilter

    β€”

    by

    Short descriptionπŸ”Ž SelectCreateLayerFilter is an AutoCAD and Civil 3D AutoLISP tool that builds a layer Properties Filter from the layers found in a selected set of drawing objects. 🧰 It adds a practical DCL interface for naming the filter, choosing the parent filter, filtering layer names with wildcards, selecting layers, copying the expression, and applying…