.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get a listing of the current table styles

3 REPLIES 3
Reply
Message 1 of 4
wbielski
355 Views, 3 Replies

How to get a listing of the current table styles

Does anybody have a code snippet that shows how to get a listing of the current table styles in the drawing

Thanks
3 REPLIES 3
Message 2 of 4
Hallex
in reply to: wbielski

Try this one

Public Shared Sub GetTableStyles()

Dim doc As Document = Application.DocumentManager.MdiActiveDocument

Dim db As Database = doc.Database

Dim did As ObjectId = ObjectId.Null

Using tr As Transaction = db.TransactionManager.StartTransaction

Try

Dim nod As DBDictionary = CType(tr.GetObject(db.NamedObjectsDictionaryId, OpenMode.ForRead), DBDictionary)

did = nod.GetAt("ACAD_TABLESTYLE")

Dim tdic As DBDictionary = CType(tr.GetObject(did, OpenMode.ForRead), DBDictionary)

For Each eDict As DictionaryEntry In tdic

If eDict.Key <> "" Then

MsgBox(eDict.Key)

End If

Next

Catch ex As System.Exception

MsgBox(ex.StackTrace)

End Try

End Using

End Sub

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 3 of 4
wbielski
in reply to: wbielski

Hallex - thanks that did the trick.
Message 4 of 4
Hallex
in reply to: wbielski

You're welcome
Cheers 🙂

~'J'~
_____________________________________
C6309D9E0751D165D0934D0621DFF27919

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost