Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ignoring Plotter Settings

Status
Not open for further replies.

Otacustes

IS-IT--Management
Apr 15, 2005
40
0
0
GB
Hello all
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

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
 
Hi Ota,

A couple of things you may try, you may try placing some updates:

Code:
objCode.Update

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top