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