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

Switching layouts with .NET

0 REPLIES 0
Reply
Message 1 of 1
ti
Participant
167 Views, 0 Replies

Switching layouts with .NET

Hi,

I have a simple form with a combobox that I fill with all layout names ;

_
Public Sub sm()
Dim fmain As New main
Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
Dim db As Database = HostApplicationServices.WorkingDatabase
Dim tr As Transaction = db.TransactionManager.StartTransaction()

Dim bt As BlockTable = tr.GetObject(db.BlockTableId, OpenMode.ForRead)

fmain.LayoutBox.Items.Clear()
For Each btrid As ObjectId In bt
Dim btr As BlockTableRecord = tr.GetObject(btrid, OpenMode.ForRead)
If btr.IsLayout Then
Dim lo As Layout = tr.GetObject(btr.LayoutId, OpenMode.ForRead)
fmain.LayoutBox.Items.Add(lo.LayoutName)
End If
Next

fmain.Show()
End Sub

I want to switch layouts from my combobox when the selectedtext changes, the following code doesn't seem to work ;
LayoutManager.Current.CurrentLayout = LayoutBox.Text

Can anyone help ?
Thanks
0 REPLIES 0

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