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

Page Setups / setting current from setups in drawing

0 REPLIES 0
Reply
Message 1 of 1
Mike.Wohletz
230 Views, 0 Replies

Page Setups / setting current from setups in drawing

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
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