Help with plotting from VBA!?!

Discussion in 'AutoCAD' started by Kevin Mullinax, Dec 16, 2003.

  1. I've just finished writing a custom Batch Plotting Utility. Everything is
    working great except for one thing... the plot settings are defaulting to
    those from the activeLayout instead of from the plot configuration I've
    created in the code. Here is the subroutine in question:

    Private Sub set_PlotConfigurations()
    Dim oPlotConfig As AcadPlotConfiguration
    Dim oPlot As AcadPlot
    Set oPlotConfig = ThisDrawing.PlotConfigurations.Add("TempPC", True)
    With oPlotConfig
    ..ConfigName = "LaserJet 8100.pc3"
    ..RefreshPlotDeviceInfo
    ..PlotType = acExtents
    ..StandardScale = acScaleToFit
    ..CanonicalMediaName = "Letter"
    ..PlotRotation = ac90degrees
    ..ShowPlotStyles = False
    ..ScaleLineweights = False
    ..CenterPlot = True
    ..PlotWithPlotStyles = True
    End With
    Set oPlot = ThisDrawing.Plot
    With oPlot
    ..SetLayoutsToPlot (aLayouts)
    ..NumberOfCopies = 1
    ..StartBatchMode (UBound(aLayouts))
    ..PlotToDevice oPlotConfig.ConfigName
    End With
    oPlotConfig.Delete
    End Sub

    What am I doing wrong? This code should cause the layouts to print with the
    "TempPC" print configurations, right? I would like to make this work using a
    configuration instead of modifying the settings of the individual layouts,
    if possible. Any help would be greatly appreciated... thanks in advance!

    Kevin Mullinax
     
    Kevin Mullinax, Dec 16, 2003
    #1
  2. First thing you need to do Kevin is issue a RefreshPlotDeviceInfo before
    you plot and issue a regen for the settings to 'stick'
    ___________________________
    Mike Tuersley
    AutoCAD Clinic
    Rand IMAGINiT Technologies
     
    Mike Tuersley, Dec 16, 2003
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.