You do not need to explode to find entities in a block definition (AcadBlock). Simply loop through the block definition to identiy the entity in the block definition. In your case, Assume, the block definition has a closed LwPolyline, which you need to know its area. So the code would be like:
@jeremye86 wrote:
FilterData(0) = "INSERT"
FilterType(0) = 0
Set oSset = acadDoc.SelectionSets.Add("SS1")
oSset.Select acSelectionSetAll, FilterType, FilterData
rowperimsht = 1
lngRow = 1
Dim area As Double
For Each objInSelect In oSset
On Error Resume Next
effName = objInSelect.EffectiveName
On Error GoTo 0
If effName = "perimShtDyn" Then
BlkAtts = objInSelect.GetAttributes
PerimShtDimsArray(rowperimsht, 1) = BlkAtts(0).textString ' pm name
PerimShtDimsArray(rowperimsht, 2) = 1 'qty
BlkAtts = objInSelect.GetDynamicBlockProperties
PerimShtDimsArray(rowperimsht, 3) = Round(BlkAtts(0).Value, 3) 'radius
PerimShtDimsArray(rowperimsht, 4) = Round(BlkAtts(2).Value, 3) 'left len
PerimShtDimsArray(rowperimsht, 5) = Round(BlkAtts(4).Value, 3) 'right len
PerimShtDimsArray(rowperimsht, 6) = Round(BlkAtts(6).Value, 3) ' bottom len
PerimShtDimsArray(rowperimsht, 7) = Round(BlkAtts(8).Value, 3) 'sht angle
area = GetArea(objInSelect.Name)
PerimShtDimsArray(rowperimsht, 8) = area
rowperimsht = rowperimsht + 1
End If
effName = ""
Next objInSelect
Private Function GetArea(blkName As String) As Double
Dim area As Double
Dim blk As AcadBlock
Dim ent As AcadEntity
Dim poly As AcadLWPolyline
Set blk=ThisDrawing.Blocks(blkName)
For Each ent In blk
If TypeOf ent Is AcadLWPolyline Then
Set poly = ent
area = poly.Area
Exit For
End If
End If
GetArea=area
End Function
HTH