Message 1 of 12
papersize
Not applicable
08-13-2010
12:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can anyone help me to add an also to edit a custom papersize to the "DWG to PDF.pc3" file. Or give me a least a hint? Thanks in advance. I'm already this far:
<CommandMethod("cpss")> _
Public Sub cpss()
Dim plottername, papersiize As String
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim acCurDb As Database = acDoc.Database
plottername = "DWG to PDF.pc3"
papersiize = "ISO_expand_A3_(420.00_x_297.00_MM)"
Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
Dim acLayoutMgr As LayoutManager
acLayoutMgr = LayoutManager.Current
Dim acLayout As Layout
acLayout = acTrans.GetObject(acLayoutMgr.GetLayoutId(acLayoutMgr.CurrentLayout), OpenMode.ForRead)
acDoc.Editor.WriteMessage(vbLf & "Current layout: " & acLayout.LayoutName)
acDoc.Editor.WriteMessage(vbLf & "Current device name: " & acLayout.PlotConfigurationName)
Dim acPlInfo As PlotInfo = New PlotInfo()
acPlInfo.Layout = acLayout.ObjectId
Dim acPlSet As PlotSettings = New PlotSettings(acLayout.ModelType)
acPlSet.CopyFrom(acLayout)
Dim acPlSetVdr As PlotSettingsValidator = PlotSettingsValidator.Current
acPlSetVdr.SetPlotConfigurationName(acPlSet, plottername, papersiize)
Dim rutte As New Extents2d(0, 0, 420, 297)
acPlSetVdr.SetPlotWindowArea(acPlSet, rutte)
acPlSetVdr.SetPlotType(acPlSet, Autodesk.AutoCAD.DatabaseServices.PlotType.Window)
acPlSetVdr.SetUseStandardScale(acPlSet, True)
acPlSetVdr.SetPlotOrigin(acPlSet, New Point2d(0, 0))
acPlSetVdr.SetPlotRotation(acPlSet, PlotRotation.Degrees000)
acPlSetVdr.SetStdScaleType(acPlSet, StdScaleType.StdScale1To1)
acPlSetVdr.SetPlotCentered(acPlSet, True)
acLayout.UpgradeOpen()
acLayout.CopyFrom(acPlSet)
acDoc.Editor.WriteMessage(vbLf & "New device name: " & acLayout.PlotConfigurationName)
acTrans.Commit()
End Using
End Sub