Plot to device

Discussion in 'AutoCAD' started by David, Feb 19, 2004.

  1. David

    David Guest

    Hi NG;

    I'm trying do develop a batch-plotting routine.
    In my office we ave 6 different paperersizes,
    and 2 of them are A4. one oriented as Portrait
    and the other one oriented as Landscape.

    In my VBA-code I create a pagesetup according to
    what kind of Printer, Paper, Plot-style aso the user has
    choosen in a properties-setup of the application.
    When they setup this values I will save the to the registry.

    They all use Centerplot and Plot area=Extents.

    Later when they want to use the batch-plot utility they
    only have to push a button and select which layout they
    want to be printed then click OK.

    I will then loop through the choosen layouts and
    to the printer that the user has choosen in the properties.setup.
    Its now that I create the Pagesetup with all its prooerties
    such as CanonicalmediaName, Configname, PlotType aso.

    I use the CopyFrom-method to copy this pagesetup to the
    layout object and then use th PlotToDevice-method to
    send it to the printer.

    My problem, at the moment, is that one papersize,
    A4 portrait, wont center correctly.
    This only happens at this printer
    "HP LaserJet 1200 Series"

    Other collegues that doesn't have this printer but an
    older one gets it all corrcet printed.

    I've checked the pagesetup that I created at computers
    that has the "HP LaserJet 1200 Series"-printer attached to it
    and I find something strange in the plotdialog.

    This is what I do when checking:
    1. Open AutoCAD and use the batch-plot utility
    to plot a drawing, A4 portrait. This will come as not centerd.
    A page setup called A4S has been created.

    2. Go to AutoCADs plot-dialog see what values each field have.

    3. Page setup name says: "A4S" That is correct.
    The papersize says: "A4". That is correct.
    The Plot offset says: "Center Plot" That is correct.
    "X: 0.01mm" This might not be
    correct
    "Y: 0.00mm" This might not be
    correct

    4. Look at the Full Preview and it looks wrong. Press ESC

    5. Now select the the same papersize thats already selected in
    the Papersize combobox. Now the magics begin!!

    6. When the same papersize is selected the Plot Offset fields changes to:
    "X: -6.23mm"
    "Y: -3.02mm"

    7. Look at the plot preview and it looks fine.

    Questions:
    Why did the plot offset change when I selected the same papersize?
    Why is it impossible to force VBA to get it centered?
    Why does it only happen to one of the printers ("HP LaserJet 1200 Series").

    --------------------------------------------
    My code that creates the pagesetup, all variables are dimed correctly:

    Set oPlotConfigs = ThisDrawing.PlotConfigurations
    Set oPlotConfig = oPlotConfigs.Add(sPageSetupName)

    oPlotConfig.RefreshPlotDeviceInfo

    With oPlotConfig
    .ConfigName = sConfigName
    .CanonicalMediaName = sC_MediaName
    .PaperUnits = sPaperUnits
    .PlotType = sPlotType
    .PlotRotation = sPlotRotaion
    .UseStandardScale = bU_S_Scale
    If bU_S_Scale = True Then
    .StandardScale = sS_Scale
    Else
    .SetCustomScale dUserScale(0), dUserScale(1)
    End If
    .CenterPlot = bCenterPlot
    .PlotHidden = bPlotHidden
    .PlotViewportsFirst = bP_VP_First
    .PlotViewportBorders = bP_VP_Borders
    .PlotWithLineweights = bP_W_Lwt
    '.PlotWithPlotStyles = bShowPStyles
    .ScaleLineweights = bScaleLwt
    .ShowPlotStyles = bShowPStyles
    .StyleSheet = sStyleSheet
    End With

    oPlotConfig.RefreshPlotDeviceInfo

    -----------------------------------------------------------
    My code that copies the plotconfig to the Layout-object and theen plot it.
    Set oALay = ThisDrawing.ActiveLayout

    oALay.CopyFrom oPlotConfig

    oALay.RefreshPlotDeviceInfo
    oALay.PlotType = acExtents
    oALay.CenterPlot = True
    oALay.RefreshPlotDeviceInfo

    ThisDrawing.Regen acAllViewports

    Set oPlot = ThisDrawing.Plot

    oPlot.PlotToDevice
     
    David, Feb 19, 2004
    #1
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.