Message 1 of 13
Get Specific Name Layouts Name and Build a list

Not applicable
07-16-2013
05:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to first get all the layouts name and add specfic layouts names to the list and call a specfic function.
So far this what I got so far.
I am able to get list all the layouts in the drawing.
' List all the layouts in the current drawing <CommandMethod("ListLayouts")> _ Public Shared Sub ListLayouts() ' Get the current document and database Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument Dim acCurDb As Database = acDoc.Database Dim i As Integer = 0 Do While (i < 10) Loop ' Get the layout dictionary of the current database Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction() Dim lays As DBDictionary = _ acTrans.GetObject(acCurDb.LayoutDictionaryId, OpenMode.ForRead) acDoc.Editor.WriteMessage(vbLf & "Layouts:") ' Step through and list each named layout and Model For Each item As DBDictionaryEntry In lays acDoc.Editor.WriteMessage(vbLf & " " & item.Key) Next ' Abort the changes to the database acTrans.Abort() End Using End Sub