Message 1 of 3
How can I delete a block in a block?

Not applicable
01-13-2007
08:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have a block (A1) in a other block (A2) - (A2(A1)) or I have
three or more blocks - (CF(G3(A1))).
The name from the blocks are always different. Only the block A1
have always the same name!
Now I must delete with VBA (AutoCAD 2005) the block A1.
The blocks A2, CF, G3, ... I can also delete, but I don´t know the name!
Dim objBlock As AcadBlock
For i = 0 To ThisDrawing.Blocks.Count - 1
Set objBlock = ThisDrawing.Blocks(i)
If objBlock.Name = "A1" Then obkBlock.Delete '<<< error, because
in the drawing is a blockreference
Next i
I have a block (A1) in a other block (A2) - (A2(A1)) or I have
three or more blocks - (CF(G3(A1))).
The name from the blocks are always different. Only the block A1
have always the same name!
Now I must delete with VBA (AutoCAD 2005) the block A1.
The blocks A2, CF, G3, ... I can also delete, but I don´t know the name!
Dim objBlock As AcadBlock
For i = 0 To ThisDrawing.Blocks.Count - 1
Set objBlock = ThisDrawing.Blocks(i)
If objBlock.Name = "A1" Then obkBlock.Delete '<<< error, because
in the drawing is a blockreference
Next i