DeleteLayerByFilter

Short description

  • DeleteLayerByFilter — embedded DCL layer deleter with filter + multi-select, using -LAYDEL scripted sequence with VLA fallback
  • v10 change: fixes the -LAYDEL command sequence to mirror manual steps: ._-LAYDEL_N<name>""_Y (plus localized fallback)
  • Excludes Xref layers and reserved layers (0, DEFPOINTS) and reports deleted vs failed
deletelayerbyfilter 000

Command:

  • DeleteLayerByFilter
  • LayDelByList

Description:

  • Provides a single-file LISP with an embedded DCL dialog titled Delete Layers by Filter to find and delete multiple layers at once.
  • Builds a list of candidate layers from the drawing, excluding Xref-dependent layers (names matching *|*) and excluding reserved layers 0 and DEFPOINTS.
  • Supports filtering by wildcard (*, ?) or by plain text (auto-wrapped as *text*), and allows multi-select in the list box.
  • Deletes selected layers primarily through Express Tools -LAYDEL using a scripted command sequence; if unavailable or unsuccessful, falls back to attempting a VLA delete as a last resort.
  • Includes an additional command that deletes layers from a user-defined list variable LAYLIST using the same deletion pipeline and reporting.

Helper function: (if any)​

  • DLBF-TempDclPath — generates a temp path for the dialog DCL file.
  • DLBF-WriteDcl — writes the embedded DCL string to disk and returns the path for load_dialog.
  • DLBF-GetAllLayers — enumerates drawing layers, excludes Xrefs (*|*) and reserved (0, DEFPOINTS), returns sorted list.
  • DLBF-Patternize — converts plain text into wildcard pattern (*text*) unless the user already supplied wildcard characters.
  • DLBF-FilterLayers — filters layer names by wcmatch against the pattern; empty pattern returns all candidates.
  • DLBF-Split — splits a string into tokens by delimiter character code (used to parse selection index strings).
  • DLBF-ParseIndexList — parses the list_box multi-select index string into a list of integers (space-delimited).
  • DLBF-IdxRangeStr — builds an index string "0 1 2 …" for Select All without relying on vl-number-sequence.
  • DLBF-LayDel — deletes a layer by name using ._-LAYDEL with sequence _N name "" _Y; retries with non-underscore N/Y fallback; verifies deletion by checking tblsearch.
  • DLBF-VLA-Delete — last-resort attempt to delete a layer via VLA (only succeeds when deletion is allowed).
  • DLBF-DeleteLayers — orchestrates deletion across names, blocks reserved/xref layers, counts successes, accumulates failures with reason tags.

Functionalities:

  • Embedded DCL UI — dialog includes filter edit box, multi-select list of matches, and buttons: Clear Filter, Select All, Select None, Delete, Cancel.
  • Layer candidate set — enumerates layers and excludes Xref-dependent names (*|*) and reserved layers (0, DEFPOINTS).
  • Filtering rules — empty filter shows all; wildcard filters are honored as-is; plain text is converted to *text* for “contains” matching.
  • Live list refresh — typing in the filter edit box updates the match list immediately by repopulating lb_layers.
  • Select All / None — Select All sets list_box selection to the full index range string; Select None clears the selection tile string.
  • Index parsing — on Delete, reads list_box selection indices, parses them into integers, and maps indices back to layer names.
  • Primary deletion path — attempts layer removal via -LAYDEL scripted input sequence and validates success by confirming the layer no longer exists in the table.
  • Fallback deletion path — if scripted deletion fails, attempts VLA deletion of the layer object as a last resort (typically only works if layer is deletable/empty).
  • Reporting — prints how many layers were deleted and lists failed layer names (including (reserved) and (xref) annotations when applicable).
  • Alternate command: LayDelByList — deletes layers from variable LAYLIST (must be a list of names) using the same checks and deletion pipeline, then prints Deleted/Failed summary.

Result:

  • Running DeleteLayerByFilter opens a filterable, multi-select list of eligible layers; selected layers are deleted using the corrected -LAYDEL scripted sequence, with a VLA fallback if necessary.
  • Reserved layers (0, DEFPOINTS) and Xref layers are not deleted and are reported as failures with reason tags.
  • Running LayDelByList performs the same deletion logic for a predefined list variable LAYLIST and reports deleted vs failed layers in the command line output.

Images, animations etc.

deletelayerbyfilter 000
deletelayerbyfilter 001
deletelayerbyfilter 002
deletelayerbyfilter 003
Pixel

Additional info:

Share this page:

Page Tag: Layers

  • DeleteLayerByFilter

    Short description DeleteLayerByFilter — embedded DCL layer deleter with filter + multi-select, using -LAYDEL scripted sequence with VLA fallback v10 change: fixes the -LAYDEL command sequence to mirror manual steps: ._-LAYDEL → _N → <name> → "" → _Y (plus localized fallback) Excludes Xref layers and reserved layers (0, DEFPOINTS) and reports deleted vs failed…

  • Color2Llayers

    Short description Comming soon … Command: Comming soon … Description: Comming soon … Helper function: (if any)​ Comming soon … Functionalities: Comming soon … Result: Comming soon … Images, animations etc. Lisp code: Expand Code ⬇ Select Code Copy Code Comming soon … Additional info: Based on / Source code: Open Website Share this page:

  • ChangeLayerToSelected

    Short description ChangeLayerToCurrent — DCL filtered layer chooser + optional “pick layer from drawing”, then move selected objects to that layer Filters layer names (non-Xref only) using a substring-style match and remembers last filter + last chosen layer After choosing a layer, prompts for a multi-selection of objects and runs CHPROP to change their layer…

  • ChangeLayer

    Short description ChangeLayer — DCL layer picker with wildcard filter and “pick from drawing” option Lists only visible layers (not off, not frozen) and supports * / ? pattern matching Remembers the last filter via environment variable and can auto-filter based on an object’s layer Command: • ChangeLayer Description: Opens a temporary DCL dialog titled…

  • All_Color2Layers

    Short description Comming soon … Command: Comming soon … Description: Comming soon … Helper function: (if any)​ Comming soon … Functionalities: Comming soon … Result: Comming soon … Images, animations etc. Lisp code: Expand Code ⬇ Select Code Copy Code Comming soon … Additional info: Based on / Source code: Open Website Share this page:

  • SwapBlockAssignLayer

    Short description Comming soon … Command: Comming soon … Description: Comming soon … Helper function: (if any)​ Comming soon … Functionalities: Comming soon … Result: Comming soon … Images, animations etc. Lisp code: Expand Code ⬇ Select Code Copy Code Comming soon … Additional info: Based on / Source code: Open Website Share this page:

  • ChangeBlockEntitiesLayer

    Short description Sort / Purpose: Make all entities inside selected block definitions use the same layer as their block references for consistent layer control. • Scope: Works on selected INSERT block references and edits the underlying block definitions in the current drawing. • Goal: Ensure that geometry inside blocks follows the block reference layer, so…

  • MultiOffsetBothSidesWithLayer

    Short description This AutoLISP routine automates the process of offsetting multiple lines on both sides with customizable distances, profiles, and layer management. It is designed to simplify symmetrical drafting operations by providing an interactive dialog for user control and configuration. Command: Command: c:MultiOffsetBothSidesWithLayer This command allows the user to select multiple line objects, define offset…