frenkas Posted April 22, 2010 Posted April 22, 2010 Hello, I need to find empty blocks in the drawing, as they are causing some problems for us. How can I get AcadBlockReference entities count using VBA? To be more precise, how can I find blocks with zero entities? currently I have this code: Dim objEntity As AcadEntity Dim objTemp As AcadBlockReference For Each objEntity In ThisDrawing.ModelSpace If TypeOf objEntity Is AcadBlockReference Then MsgBox objTemp.EffectiveName ... What can I do with objTemp to find out about those entities within block? Quote
frenkas Posted April 22, 2010 Author Posted April 22, 2010 I did that myself.. Turns out that I can only find block entities count with AcadBlock not AcadBlockReference. Soo I did get the results I wanted with this extra function: Private Function GetBlock(pavadinimas As String) As AcadBlock Dim aa As Integer For aa = 1 To ThisDrawing.Blocks.Count 'MsgBox ThisDrawing.Blocks(aa - 1).Name If ThisDrawing.Blocks(aa - 1).Name = pavadinimas Then Set GetBlock = ThisDrawing.Blocks(aa - 1) Exit Function End If Next aa End Function .. and the AcadBlock object has Count property in it. That's all I needed Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.