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,