Chris,
You should open the blockReference's blockTableRecord to get its name.
For example:
_
Public Sub AsdkTest()
Dim db As Database = HostApplicationServices.WorkingDatabase
Dim Ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
Dim trans As Transaction = Application.DocumentManager.MdiActiveDocument.TransactionManager.StartTransaction
Try
Dim Opts As New PromptSelectionOptions()
'Build a filter list so that only block references are selected
Dim filList() As TypedValue = {New TypedValue(DxfCode.Start, "INSERT")}
Dim filter As SelectionFilter = New SelectionFilter(filList)
Dim res As PromptSelectionResult = Ed.GetSelection(Opts, filter)
'Do nothing if selection is unsuccessful
If Not res.Status = PromptStatus.OK Then Return
Dim SS As Autodesk.AutoCAD.EditorInput.SelectionSet = res.Value
Dim idArray As ObjectId() = SS.GetObjectIds()
Dim blockRefId As ObjectId
For Each blockRefId In idArray
Dim blRef As BlockReference
blRef = trans.GetObject(blockRefId, OpenMode.ForRead)
Dim btr As BlockTableRecord
btr = trans.GetObject(blRef.BlockTableRecord(), OpenMode.ForRead)
Ed.WriteMessage(vbCrLf + btr.Name + vbCrLf)
Next
Finally
trans.Dispose()
End Try
End Sub
Krishna Kalvai
DevTech
Autodesk
Message was edited by: KrishnaK