• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    .NET

    Reply
    Member
    Posts: 3
    Registered: ‎10-21-2008

    How to get a listing of the current table styles

    177 Views, 3 Replies
    10-28-2008 04:42 PM
    Does anybody have a code snippet that shows how to get a listing of the current table styles in the drawing

    Thanks
    Please use plain text.
    *Expert Elite*
    Hallex
    Posts: 1,334
    Registered: ‎10-08-2008

    Re: How to get a listing of the current table styles

    10-29-2008 02:26 AM 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
    Please use plain text.
    Member
    Posts: 3
    Registered: ‎10-21-2008

    Re: How to get a listing of the current table styles

    10-29-2008 04:52 AM in reply to: wbielski
    Hallex - thanks that did the trick.
    Please use plain text.
    *Expert Elite*
    Hallex
    Posts: 1,334
    Registered: ‎10-08-2008

    Re: How to get a listing of the current table styles

    10-29-2008 05:30 AM in reply to: wbielski
    You're welcome
    Cheers :smileyhappy:

    ~'J'~
    _____________________________________
    C6309D9E0751D165D0934D0621DFF27919
    Please use plain text.