Message 1 of 8

Not applicable
06-13-2011
10:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The Pagesetup isn't showing up in the Pagesetup dialog.
But when I close the drawing and open it up it's visible.
What am I missing here? Still new with this transaction concept...
<CommandMethod("aps")> _ Public Sub AddPlotSetting() 'TODO: Finish Cleaning Print Function Dim s_PlotSettingsFile As String = "c:\test.dwg Dim s_PageSetupName As String = "catdog" Dim s_MediaName As String = "11 x 17" Dim s_PlotDeviceName As String = "\\rdops1\RDO0071" Dim s_StyleSheetName As String = "Monochrome.ctb" Dim d_PaperHeight As Double = 11 Dim d_PaperWidth As Double = 17 Dim is_PlotStyles As Boolean = True Dim int_PlotRotation As PlotRotation = PlotRotation.Degrees000 Dim int_PlotType As Autodesk.AutoCAD.DatabaseServices.PlotType = Autodesk.AutoCAD.DatabaseServices.PlotType.Extents Dim int_StandardScale As Integer = StdScaleType.ScaleToFit Dim is_PlotCentered As Boolean = True Dim myPoint As New Autodesk.AutoCAD.Geometry.Point2d(2, 4) Dim CurrentDatabase As Database = Application.DocumentManager.MdiActiveDocument.Database Using currentTransaction As Transaction = CurrentDatabase.TransactionManager.StartTransaction 'TODO: Confirm New Print Object is Created 'Create PlotSetting Dim pl As PlotSettings = New PlotSettings(True) 'Set the PageSetup Name pl.PlotSettingsName = s_PageSetupName 'Create PlotSettingsValidator Dim psv As PlotSettingsValidator = PlotSettingsValidator.Current 'Set Plot Type psv.SetPlotType(pl, Autodesk.AutoCAD.DatabaseServices.PlotType.Extents) 'set plot scale psv.SetUseStandardScale(pl, True) psv.SetStdScaleType(pl, StdScaleType.ScaleToFit) 'psv.SetStdScale(pl, 0.0) 'Center the plot psv.SetPlotCentered(pl, True) 'Rotation psv.SetPlotRotation(pl, PlotRotation.Degrees000) psv.SetPlotOrigin(pl, myPoint) 'Set Media Size psv.SetCanonicalMediaName(pl, "Letter") 'psv.SetClosestMediaName(pl, d_PaperWidth, d_PaperHeight, PlotPaperUnit.Inches, True) 'TODO: Validate StyleSheetName psv.SetCurrentStyleSheet(pl, s_StyleSheetName) '' Set the plot device to use psv.SetPlotConfigurationName(pl, s_PlotDeviceName, "Letter") 'Make Default PageSetup Yes/No? ' psv.SetDefaultPlotConfig(pl) 'Add to Plot Settings to Drawing Database pl.AddToPlotSettingsDictionary(CurrentDatabase) currentTransaction.Commit() End Using End Sub
Solved! Go to Solution.