I am a bit lost on this one, I have page setups in the current drawing and I am looking for a way to set one of them current. I have the following code that I have used to get the name and ID of each page setup. I don’t know if what I have is even on the right track, but I would like to set one of the page setups current in the active layout.
I have tried a few ways to do this using the copy from method in the layout passing the e.Value from the code but my error is that it is not a rxObject.
Can someone set me in the right direction? I am lost..
Dim oAcadDB As Autodesk.AutoCAD.DatabaseServices.Database = ApplicationServices. _
Application.DocumentManager.MdiActiveDocument.Database
Dim oAcadTransactionManager As Autodesk.AutoCAD.DatabaseServices. _
TransactionManager = oAcadDB.TransactionManager
Dim oAcadTransaction As Transaction = oAcadTransactionManager. _
StartTransaction()
Dim oPlotSettingsObjectID As ObjectId = _
oAcadDB.PlotSettingsDictionaryId
Dim oPlotSettingsDBDictionary As Autodesk.AutoCAD.DatabaseServices.DBDictionary = _
CType(oAcadTransaction.GetObject(oPlotSettingsObjectID, OpenMode.ForWrite, False, False), _
DBDictionary)
For Each e As DictionaryEntry In oPlotSettingsDBDictionary
MsgBox(String.Format("{0}" & vbCrLf & "{1}", e.Key, e.Value))
Next
Thanks
Mike