Error Plotting Layers

Discussion in 'AutoCAD' started by ericju, Sep 11, 2004.

  1. ericju

    ericju Guest

    The setup is that all layers are off. This is meant to turn each layer on individually and plot it to a file, then turn it off and plot the next layer. It plots the first file fine, but throws an error on the second file (error shown below).

    Any ideas why it is failing on the 2nd file?

    dim i as Integer
    dim L as AcadLayer

    i = 0
    For Each L In ThisDrawing.Layers
    L.LayerOn = True
    ThisDrawing.Regen acAllViewports
    ThisDrawing.Plot.PlotToFile "File-" & i & ".plt"
    L.LayerOn = False
    i = i + 1
    Next L

    Run-time error '-2147467259 (80004005)':
    Method 'PlotToFile' of object 'IAcadPlot' failed
     
    ericju, Sep 11, 2004
    #1
  2. ericju

    nimesh811 Guest

    This has to do with background plotting in 2005.

    set your system variable "BACKGROUNDPLOT" to 0

    or

    add the following line in your .lsp file:

    (setvar "BACKGROUNDPLOT" 0)
     
    nimesh811, Dec 28, 2004
    #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.