hi,
so i need to read the attrbuteReference, do you have a sample code VB.net or C#.
now i'm doing this
Dim bt As BlockTable = trans.GetObject(db.BlockTableId, OpenMode.ForRead)
'CType(trans.GetObject(db.BlockTableId, OpenMode.ForRead), BlockTable)
Dim btr As BlockTableRecord = trans.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForRead)
'CType(trans.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForRead), BlockTableRecord)
Dim id As ObjectId
Dim idnr As Int32
Dim attref As AttributeReference = New AttributeReference()
idnr = 0
For Each id In btr
Dim ent As Entity = trans.GetObject(id, OpenMode.ForRead, False)
'CType(trans.GetObject(id, OpenMode.ForRead, False), Entity)
If TypeOf ent Is BlockReference Then
Dim saEmployeeList(-1) As String
Dim Blk As BlockReference = CType(ent, BlockReference)
Dim br As BlockTableRecord = CType(trans.GetObject(Blk.BlockTableRecord, OpenMode.ForRead, False), BlockTableRecord)
blockname = br.Name
'ListBlocks(id, saEmployeeList, blockname)
Dim sEmployeeData As String
Dim empBtr As BlockTableRecord = trans.GetObject(bt(blockname), OpenMode.ForRead)
ac = Blk.AttributeCollection
Dim entid As ObjectId
For Each entid In empBtr
Dim entt As Entity = trans.GetObject(entid, OpenMode.ForRead, False)
If TypeOf entt Is AttributeDefinition Then
Dim attDef As AttributeDefinition = CType(entt, AttributeDefinition)
attref.SetPropertiesFrom(attDef)
attref.Tag = attDef.Tag
ed.WriteMessage("Block tag = " + attDef.Tag + ControlChars.Lf)
ed.WriteMessage("Tag String = " + " " + attDef.Prompt + ControlChars.Lf)
ed.WriteMessage("Tag String = " + " " + attDef.TextString + ControlChars.Lf)
End If
Next
the above code just give me the Tag and prompt, thanks