.NET

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

Plot Style Validator --- InvalidInput

391 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,
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!