Ignoring Plotter Settings
Ignoring Plotter Settings
(OP)
Hello all
I have written the following code:
Now, the problem is that although this does produce a print, it ignores the fact that I want it extents, monochrome, centered etc and just prints as it is ont he screen.
If I debug the program just before printing, the plot configuration does reflect the changes I requested, but the actual printer (or somewhere in between) seems to ignore them.
Does anyone have any ideas?
Thanks
I have written the following code:
CODE
Sub MainTest()
Dim objConfig As AcadPlotConfiguration
Dim blnResult As Boolean
Set objConfig = ThisDrawing.Application.ActiveDocument.PlotConfigurations.Add("New")
ThisDrawing.ModelSpace.Layout.RefreshPlotDeviceInfo
With objConfig
.ConfigName = "[URL="file://\\BLBEDC02\DO"]\\BLBEDC02\DO[/URL] LaserJet 5100"
.CanonicalMediaName = "A4"
.StandardScale = acScaleToFit
.PlotType = acExtents
.StyleSheet = "Monochrome.ctb"
.PlotRotation = ac0degrees
.CenterPlot = True
End With
ThisDrawing.Application.ActiveDocument.Regen acAllViewports
blnResult = ThisDrawing.Application.ActiveDocument.Plot.PlotToDevice(objConfig.ConfigName)
objConfig.Delete
Set objConfig = Nothing
End Sub
Dim objConfig As AcadPlotConfiguration
Dim blnResult As Boolean
Set objConfig = ThisDrawing.Application.ActiveDocument.PlotConfigurations.Add("New")
ThisDrawing.ModelSpace.Layout.RefreshPlotDeviceInfo
With objConfig
.ConfigName = "[URL="file://\\BLBEDC02\DO"]\\BLBEDC02\DO[/URL] LaserJet 5100"
.CanonicalMediaName = "A4"
.StandardScale = acScaleToFit
.PlotType = acExtents
.StyleSheet = "Monochrome.ctb"
.PlotRotation = ac0degrees
.CenterPlot = True
End With
ThisDrawing.Application.ActiveDocument.Regen acAllViewports
blnResult = ThisDrawing.Application.ActiveDocument.Plot.PlotToDevice(objConfig.ConfigName)
objConfig.Delete
Set objConfig = Nothing
End Sub
Now, the problem is that although this does produce a print, it ignores the fact that I want it extents, monochrome, centered etc and just prints as it is ont he screen.
If I debug the program just before printing, the plot configuration does reflect the changes I requested, but the actual printer (or somewhere in between) seems to ignore them.
Does anyone have any ideas?
Thanks
All help is greatly appreciated
Kind regards
Ota
RE: Ignoring Plotter Settings
A couple of things you may try, you may try placing some updates:
CODE
You may even try adding a DoEvents to allow AutoCAD to catch up with everything your doing. It seemed to me I was better off adding the config and checking for it's existence and then if it wasn't there adding it, but I then had to make sure AutoCAD had time to update all of its tables, (plot tables, style tables etc), before I sent it on it's merry way.
I seems to me I also had to use the plot object as well in order to get the settings to stick, you may give that a shot as well...
HTH
Todd