Function Syntax: ExplodeBlocks Version: 1.1 Date: 27.06.2026 19:50:35 Version: 1.2 Date: 20.06.2026 6:38:48PM WEB id: xbp9e2 short_description: | SEO Description 🚀 ExplodeBlocks is an AutoCAD and Civil 3D AutoLISP utility for exploding difficult block references that standard AutoCAD EXPLODE may refuse. It targets protected block definitions, non-uniformly scaled block references, nested block workflows, and block cleanup tasks. The main benefit is faster DWG cleanup, easier block editing, better CAD production control, and fewer manual explode workarounds. command: | Main Command and Loading Method 🧰 Load the LISP file with APPLOAD or another AutoCAD AutoLISP loading method. Run ExplodeBlocks to start the block explosion workflow. The implemented AutoLISP command function is c:ExplodeBlocks. The file header mentions XB as a command concept, but the uploaded code does not define c:XB. The target platform is AutoCAD and Civil 3D with Visual LISP COM support. description: | Detailed Description 📘 This AutoLISP routine processes selected block references and tries to convert them into editable AutoCAD geometry. 🔍 The user selects block references through a filtered selection set that accepts only INSERT objects. 🔒 For normal cases, the routine temporarily enables the block definition Explodable property, runs native AutoCAD ._EXPLODE, and restores the previous setting. 📐 When native explode fails, the routine builds an insertion transformation from the block insertion point, rotation, and scale factors. 🧩 It then attempts to copy entities from the block definition, transform them into drawing coordinates, and delete the original block reference. This is useful for AutoCAD drawing cleanup, Civil 3D production drawings, block editing, DWG standardization, and geometry preparation. helper_function: | Helper Logic 🚀 Command entry point - c:ExplodeBlocks starts the workflow and processes each selected block reference. 🔍 Selection filter - ssget with INSERT limits the operation to block references. 🔒 Native explode helper - _try-native-explode temporarily changes the block definition Explodable property and runs ._EXPLODE. 📐 Matrix builder - _blkref-matrix builds a 4x4 transform from insertion point, scale, and rotation. 🧩 Block definition resolver - _blkdef-from-ref finds the matching block definition for the selected reference. 🔄 Manual fallback - _manual-explode copies definition entities, applies vla-TransformBy, and deletes the original reference. 📊 Batch status reporting - the routine prints exploded and failed counts at the end of the command. functionalities: | Functionalities 🚀 Explode selected blocks - converts selected block references into editable AutoCAD geometry. 🔒 Handle protected explode settings - temporarily enables blocked explode behavior on the block definition. 📐 Support non-uniform scale fallback - uses manual transformed copies when native explode fails. 🧩 Batch process multiple block references - processes every selected INSERT in one run. 🔄 Use native AutoCAD explode first - preserves the standard AutoCAD workflow where possible. 🧹 Delete original reference after manual fallback - removes the selected block reference after replacement geometry is created. 📌 Support nested block cleanup - can expose nested blocks one level at a time depending on the block definition. 📊 Report operation result - prints success and failure counts in the AutoCAD command line. result: | Final Result ✅ The final result is a productivity-focused AutoCAD and Civil 3D block explosion utility for difficult, protected, or non-uniformly scaled block references. It helps reduce manual troubleshooting, improves DWG cleanup, supports faster block editing, and prepares drawing geometry for production, export, coordination, and quality control. additional_info: | Important Notes and Limitations 🔴 The manual fallback can erase the original selected block reference after copied geometry is created. 📌 The implemented command is ExplodeBlocks, while XB is mentioned only in the header comment. 🟧 The manual fallback adds copied definition geometry to ModelSpace, so paper-space use should be checked carefully. 🏷️ Attribute values may not be preserved by the manual fallback because it copies block definition entities rather than reference-specific attribute values. 🔄 Nested blocks may require additional runs because the routine can work one level at a time. 🧰 The code requires Visual LISP COM functions such as vlax-get-acad-object, vla-TransformBy, and vlax-tmatrix.