Accessing Nested Block References
Use this trick to access a nested block reference which is normally not accessible using the model/paper space iterations or selection set filters.
Code:
Public Function getNestedBlockRef(ByVal strBlkRefName As String) As AcadBlockReference
Dim objBlk As AcadBlock
Dim objBlkRef As AcadBlockReference
Dim objEnt As AcadEntity
For Each objBlk In ThisDrawing.Blocks
For Each objEnt In objBlk
If TypeOf objEnt Is AcadBlockReference Then
If StrComp(objEnt.Name, strBlkRefName, vbTextCompare) = 0 Then
Set getNestedBlockRef = objEnt
Exit Function
End If
End If
Next
Next
Set getNestedBlockRef = Nothing
End Function