Function Syntax: DelSelectBlock Version: 1.0 Date: 09.07.2026 6:26:32PM https://forums.augi.com/showthread.php?36146-Remove-Delete-Block-from-multiple-Layouts-at-the-same-time short_description 🚀 DelSelectBlock is an AutoCAD AutoLISP and DCL utility for deleting every block reference that matches a selected raw block name in the active DWG drawing. It helps CAD users remove repeated block instances, manage drawing cleanup, optionally purge block definitions, and keep deletion settings saved between sessions. command 🧰 Load the LISP file with APPLOAD or load DelSelectBlock_DCL.lsp from the AutoCAD command line. ▶️ Run DelSelectBlock to open the generated DCL dialog. 📌 Select a block name, type a raw name manually, or use Pick < to choose a block reference from the drawing. 🔒 The target platform is AutoCAD with Visual LISP COM support through vl-load-com. description 📘 DelSelectBlock scans the active AutoCAD drawing for block references and builds a dialog list of available raw block names. 🔍 The user can select a block from the popup list, type a manual raw name, or pick an entity from the drawing to fill the name field. 🧹 After confirmation, the program finds all matching INSERT entities and deletes them with ActiveX object deletion. The tool is useful for AutoCAD block cleanup, repeated symbol removal, DWG simplification, and faster production drawing management. Important: this command is destructive because it deletes all matching block references in the drawing. helper_function • 🚀 Command entry point - C:DelSelectBlock loads settings, opens the dialog, counts matches, confirms deletion, deletes objects, and reports the result. • 🧩 Dynamic DCL generation - DSB:DclLines, DSB:WriteDcl, and DSB:UniqueDialogName create the temporary dialog at runtime. • 📋 Block name scan - DSB:InsertBlockNames uses ssget "_X" with the INSERT filter to collect unique block names. • 🧠 Settings persistence - DSB:LoadSettings and DSB:SaveSettings manage DelSelectBlock.cfg, history, options, and dialog position. • 🔍 Pick from drawing - DSB:PickBlockName validates selected entities and accepts only block references. • 🔐 Wildcard-safe matching - DSB:EscapeWildcards escapes special characters so anonymous and dynamic raw block names can match literally. • 🧹 Deletion engine - DSB:DeleteByName converts entities with vlax-ename->vla-object and deletes them with vla-delete. • 🔴 Optional purge logic - DSB:PurgeBlockByName attempts to remove the matching block definition after instances are deleted. • 📌 Delete confirmation - DSB:ConfirmDelete shows how many instances will be deleted when confirmation is enabled. functionalities 🚀 Delete selected block name - removes every block reference in the active drawing that matches the chosen raw block name. 🔍 Scan all block references - lists available INSERT block names from the current DWG. 📌 Pick block from drawing - selects one block reference and fills the dialog with its raw block name. 📝 Manual block name input - supports direct typing of a raw block name for advanced cleanup. 🧠 Recent block history - remembers recent block names and makes repeated cleanup faster. 🔒 Optional confirmation - shows the number of matching instances before deletion. 🧹 Optional block definition purge - attempts to remove the matching block definition after deleting references. 🎨 Persistent dialog position - saves and restores the DCL window position. 📋 Configuration file support - stores options in DelSelectBlock.cfg. 🔐 Wildcard-safe selection - handles special raw block names including anonymous dynamic names. 🧰 Command-line feedback - reports deleted and failed instances. result ✅ The final result is a practical AutoCAD block cleanup utility that removes repeated block references from a DWG faster than manual selection. It centralizes block name selection, drawing-based picking, confirmation, optional purge, saved settings, and deletion reporting in one DCL workflow. additional_info 🔴 Destructive operation - matching block references are deleted from the drawing. ⚠️ Raw name matching - the code uses block reference group code 2, so dynamic blocks may be matched by anonymous raw names instead of effective names. 📌 Global drawing scope - the code uses ssget "_X", so matching block references can be found across the drawing database. 🔒 Layer limitation - objects on locked layers or protected objects may fail to delete and are reported as failed. 🧹 Purge limitation - block definition deletion may fail if the definition is still referenced or protected. 📘 DCL note - the dialog is generated as a temporary file at runtime and removed after use.