CanonShooter
Structural
- Oct 14, 2005
- 39
I am using AutoCAD 2004, and trying to delete a block in VBA.
I get an error that the block or object is referenced. In looking thru the help files, I noticed that the Blocks Collection does not have a delete function. But I don't want to delete the whole collection, just a block. Basically, what I tried is:
Dim ABCBlock As AcadBlock
Set ABCBlock = ThisDrawing.Blocks.Item("Canon_Block")
ABCBlock .Delete
I know the block is there. Purge will delete it, but I guess I am just having a mental block on deleting it with code. Any ideas?
I get an error that the block or object is referenced. In looking thru the help files, I noticed that the Blocks Collection does not have a delete function. But I don't want to delete the whole collection, just a block. Basically, what I tried is:
Dim ABCBlock As AcadBlock
Set ABCBlock = ThisDrawing.Blocks.Item("Canon_Block")
ABCBlock .Delete
I know the block is there. Purge will delete it, but I guess I am just having a mental block on deleting it with code. Any ideas?