1

I get the error IAutocadPlotFailed inside Autocad VBA macro. My code iterates over a collection of drawings and plots and saves them to png. I have managed to narrow down the error to being that the plotting mechanism run async.

Due to being able to have only one instance of the Plotting mechanism, if code moves faster than the Plot. It prints an error.

Is there any way that the plot can run in sync with the app?

Meaning if i call the plotting mechanism inside Autocad to wait until it calls the next plot.

panoskarajohn
  • 1,846
  • 1
  • 21
  • 37
  • What is `ThisDrawing`? What happens if you comment out `ThisDrawing.Close (False)` ? – Flakes Oct 06 '17 at 09:58
  • 1
    There is a system variable in AutoCAD that toggles whether or not to plot async, but I cant remember what it is... – braX Oct 06 '17 at 12:28
  • 1
    Yes it is the backgroundplot variable. Once you set it to 0. It works. Do you mind posting it as an answer? – panoskarajohn Oct 06 '17 at 12:42

1 Answers1

1

The BACKGROUNDPLOT system variable determines whether background plotting is turned on or off for plotting and publishing (except when the plot is issued from an AutoCAD Script file); if background plotting is enabled, the plotting jobs will be processed asynchronously using a separate thread.

If you set this system variable to 0, all plotting jobs will be processed in the foreground.

Lee Mac
  • 15,615
  • 6
  • 32
  • 80