Of course not good coding practice hard-coding values, should be broken, etc...........
but here is some code to maybe get you started that just prints all the attribute reference's to the command line, and of course you need to change the drawing path.
<CommandMethod("OpenDrawingInSideDatabase")> _
Public Sub OpenDrawingInSideDatabase()
Dim doc As Document = Application.DocumentManager.MdiActiveDocument
Dim db As Database = doc.Database
Dim ed As Editor = doc.Editor
Using sideDb As New Database(False, True)
sideDb.ReadDwgFile("C:\Testing\AutoCAD\AttTest.dwg", FileOpenMode.OpenForReadAndAllShare, False, "")
Using trx As Transaction = sideDb.TransactionManager.StartTransaction
Dim bt As BlockTable = trx.GetObject(sideDb.BlockTableId, OpenMode.ForRead)
For Each btrId As ObjectId In bt
Dim btr As BlockTableRecord = trx.GetObject(btrId, OpenMode.ForRead)
If btr.IsLayout Or btr.IsFromExternalReference Or btr.IsDependent Then
Continue For
End If
If btr.HasAttributeDefinitions Then
Dim brefIds As ObjectIdCollection = btr.GetBlockReferenceIds(True, False)
For Each brefId As ObjectId In brefIds
Dim bref As BlockReference = trx.GetObject(brefId, OpenMode.ForRead)
For Each attRefId As ObjectId In bref.AttributeCollection
Dim attref As AttributeReference = trx.GetObject(attRefId, OpenMode.ForRead)
ed.WriteMessage("{0}{1} = {2}{0}", Environment.NewLine, attRef.Tag, attRef.TextString)
Next
Next
End If
Next
End Using
End Using
End Sub