How to delete block by its name

How to delete block by its name

Anonymous
Not applicable
387 Views
1 Reply
Message 1 of 2

How to delete block by its name

Anonymous
Not applicable
Dear sir

In my drawing i had created my blocks with various tags. I would like to know how to list all the blocks in the listbox in the userform.
how to select a block by its name and how to delete the block by its name.....

Please give your advice

mallikarjun.g
0 Likes
388 Views
1 Reply
Reply (1)
Message 2 of 2

HJohn1
Advocate
Advocate
The way I would go about it is: Create an AcadSelectionSet of all the block inserts (AcadBlockReferences), you can filter the selection if you want to limit which inserts are selected. Then, load the names of the inserts into an array and assign the array to the List property of the ListBox, you can sort the array if you want. Finally, to delete the selected insert, just wire up the Click event of a button. Create a SelectionSet with the name of the insert selected on the ListBox and delete it. If you are not very familiar with all these steps then, do some homework on: Difference between AcadBlock and AcadBlockReference objects, creating SelectionSets and how to use filters and sorting arrays. There must be a lot of samples in this group. Good luck.
0 Likes