.NET

Reply
Active Contributor
Chris Ludtke
Posts: 44
Registered: ‎04-12-2005
Message 1 of 1 (378 Views)

Plot Style Validator --- InvalidInput

378 Views, 0 Replies
06-24-2005 03:07 PM
Here is my code

:::::::::::::::::
Try
oNewPlotSetting.PlotSettingsName = "AutoCAD PostScript File Writer.pc3"
With oPlotSettingsValidator
.SetStdScale(oNewPlotSetting, 1)
.SetUseStandardScale(oNewPlotSetting, True)
.SetStdScaleType(oNewPlotSetting, StdScaleType.StdScale1To1)
.SetPlotRotation(oNewPlotSetting, PlotRotation.Degrees000)
.SetPlotPaperUnits(oNewPlotSetting, PlotPaperUnit.Inches)
Dim oWindow As New Autodesk.AutoCAD.DatabaseServices.Extents2d(0, 0, 34, 22)
.SetPlotType(oNewPlotSetting, Autodesk.AutoCAD.DatabaseServices.PlotType.Window)
oWindow = Nothing
.SetPlotWindowArea(oNewPlotSetting, oWindow)
.SetPlotOrigin(oNewPlotSetting, ac2dOriginPoint)
.SetPlotCentered(oNewPlotSetting, True)
.SetPlotOrigin(oNewPlotSetting, ac2dOriginPoint)
.SetZoomToPaperOnUpdate(oNewPlotSetting, True)
.SetCanonicalMediaName(oNewPlotSetting, MyBase.CananicalPaperSize)
.SetCurrentStyleSheet(oNewPlotSetting, "monochrome.ctb")
End With
Catch ex As Exception
End TryIf my_Layout.LayoutName <> "Model" Then
Dim oNewPlotSetting As New PlotSettings(False) ' False Paperspace, True ModelSpace
Try
'oNewPlotSetting.PlotSettingsName = PDFDeviceName ' looking for .pc3 file name
oNewPlotSetting.PlotSettingsName = "AutoCAD PostScript File Writer.pc3"
'oNewPlotSetting.PlotSettingsName = "Test this"
oNewPlotSetting.AddToPlotSettingsDictionary(oAcadDB)
With oPlotSettingsValidator
'.SetPlotConfigurationName(oNewPlotSetting, PDFDeviceName, MyBase.FormatSize)
.SetStdScale(oNewPlotSetting, 1)
.SetUseStandardScale(oNewPlotSetting, True)
.SetStdScaleType(oNewPlotSetting, StdScaleType.StdScale1To1)
.SetPlotRotation(oNewPlotSetting, PlotRotation.Degrees000)
.SetPlotPaperUnits(oNewPlotSetting, PlotPaperUnit.Inches)
'Dim oWindow As New Autodesk.AutoCAD.DatabaseServices.Extents2d(ac2dOriginPoint.X, ac2dOriginPoint.Y, ac2dURPoint.X, ac2dURPoint.Y)
Dim oWindow As New Autodesk.AutoCAD.DatabaseServices.Extents2d(0, 0, 34, 22)
.SetPlotType(oNewPlotSetting, Autodesk.AutoCAD.DatabaseServices.PlotType.Window)
oWindow = Nothing
.SetPlotWindowArea(oNewPlotSetting, oWindow)
.SetPlotOrigin(oNewPlotSetting, ac2dOriginPoint)
.SetPlotCentered(oNewPlotSetting, True)
.SetPlotOrigin(oNewPlotSetting, ac2dOriginPoint)
.SetZoomToPaperOnUpdate(oNewPlotSetting, True)
.SetCanonicalMediaName(oNewPlotSetting, MyBase.CananicalPaperSize)
.SetCurrentStyleSheet(oNewPlotSetting, "monochrome.ctb")
End With

Catch ex As Exception
End Try
:::::::::::

The "SetPlotType" line will work with "Layout" but it will not work with "Window"

The COM interface will not let you set the type to window without the window being defined. I have tried it both ways.

Am I running into a bug?

Also,
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.