Delete Blocks

Function Syntax delblocks
Current Version 1.1
Download DeleteBlocksV1-1.lsp
View HTML Version DeleteBlocksV1-1.html

Program Description

This program enables the user to quickly remove multiple blocks from a drawing.

After invoking the program with the command delblocks at the AutoCAD command-line, the user is prompted to select a block to delete. At this prompt, the user may either select a block reference from the drawing, type N to choose a block by name, or exit the program by typing E or by dismissing the prompt.

By opting to choose a block by name, the user is presented with a simple dialog interface consisting of a list box and filter. The dialog provides a list of all standard & dynamic blocks defined in the active drawing, excluding anonymous blocks and xrefs. From this list, the user may select multiple blocks to be deleted from the active drawing.

Upon the user selecting a block from the drawing or selecting one or more block names from the dialog, the program will delete all primary & nested references of the blocks from all layouts of the active drawing, and will proceed to delete the respective block definitions, if possible.

The user will be informed at the command-line of those blocks successfully deleted by the program, and those blocks that the program was unable to remove.

The program also defines the function LM:deleteblocks so that users who wish to remove multiple blocks from several drawings in a batch processing operation may bypass the dialog and call this function with a VLA Document Object and a list of block names (case-insensitive) from a Script or another LISP application. This function is also compatible with ObjectDBX and hence may be utilised in conjunction with my ObjectDBX Wrapper function.



Instructions for Running

Please refer to How to Run an AutoLISP Program.


increase · reset · decrease

Designed & Created by Lee Mac © 2010