Deleting HIDDEN blocks?

Deleting HIDDEN blocks?

Anonymous
Not applicable
361 Views
1 Reply
Message 1 of 2

Deleting HIDDEN blocks?

Anonymous
Not applicable
How do I delete the AVE_render and ave_global blocks from my drawing via
code? These blocks are interfering with my code for a block count program.

Thanks

Steven Craig Basham
0 Likes
362 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
I don't know about deleting the blocks... but i would probably filter them
from my count.

Sub test()
Dim blockCount As Integer
blockCount = ThisDrawing.Blocks.Count
Dim i As Integer, NumNotCounted As Long
NumNotCounted = 0
For i = 0 To ThisDrawing.Blocks.Count - 1
If BlockIsNotCounted(ThisDrawing.Blocks(i)) Then NumNotCounted =
NumNotCounted + 1
Next 'element
blockCount = blockCount - NumNotCounted
MsgBox blockCount
End Sub

Function BlockIsNotCounted(blk As Variant) As Boolean
' boolean function will default to False... meaning block IS counted
Select Case LCase$(blk.Name)
Case "ave_render", "ave_global"
BlockIsNotCounted = True
End Select
End Function






"Steven Craig Basham" wrote in message
news:1B2DE5CC2880808EA9B8BD27B8DA24ED@in.WebX.maYIadrTaRb...
> How do I delete the AVE_render and ave_global blocks from my drawing via
> code? These blocks are interfering with my code for a block count
program.
>
> Thanks
>
> Steven Craig Basham
>
>
0 Likes