Nate,
Try this:
[code]
Dim ss As Autodesk.AutoCAD.Interop.AcadSelectionSet = Nothing
Try
ss = ThisDrawing.SelectionSets.Add("ss")
Catch ex As Exception
ss = ThisDrawing.SelectionSets.Item("ss")
ss.Clear()
End Try
If Not ss Is Nothing Then
Dim fType(2) As Short, fData(2) As Object
fType(0) = 0 : fData(0) = "INSERT"
fType(1) = 2 : fData(1) = "Sheet Text 30x42"
fType(2) = 8 : fData(2) = "A-Tblk-Text"
ss.Select(Autodesk.AutoCAD.Interop.Common.AcSelect.acSelectionSetAll, , , fType, fData)
For Each aEnt As Autodesk.AutoCAD.Interop.Common.AcadEntity In ss
Dim atts As Object = Nothing
Select Case True
Case TypeOf aEnt Is Autodesk.AutoCAD.Interop.Common.AcadBlockReference
Dim acdBlock As Autodesk.AutoCAD.Interop.Common.AcadBlockReference = _
DirectCast(aEnt, Autodesk.AutoCAD.Interop.Common.AcadBlockReference)
atts = acdBlock.GetAttributes
Case TypeOf aEnt Is Autodesk.AutoCAD.Interop.Common.AcadExternalReference
Dim acdExtRef As Autodesk.AutoCAD.Interop.Common.AcadExternalReference = _
DirectCast(aEnt, Autodesk.AutoCAD.Interop.Common.AcadExternalReference)
atts = acdExtRef.GetAttributes
Case TypeOf aEnt Is Autodesk.AutoCAD.Interop.Common.AcadMInsertBlock
Dim acdMBlock As Autodesk.AutoCAD.Interop.Common.AcadMInsertBlock = _
DirectCast(aEnt, Autodesk.AutoCAD.Interop.Common.AcadMInsertBlock)
atts = acdMBlock.GetAttributes
Case Else
Debug.Assert(False, "Unhandled Type in selection set, " & TypeName(aEnt))
End Select
If Not atts Is Nothing Then
'Do stuff with atts
End If
Next
Else
MsgBox("Unable to obtain selection set", _
MsgBoxStyle.ApplicationModal Or _
MsgBoxStyle.Exclamation Or _
MsgBoxStyle.OkOnly, "Selection Set Error")
End If
[/code]