views:

220

answers:

2

Hi, i am leveraging the AutoCad API's to do the following...

1] open autocad 2] load a document 3] print the document 4] close autocad

All this is working fine except for the fact that autocad is closing too quickly before the document has finished spooling off. To get around this i have subscribed to the EndPlot event (printing has finished) and then tried to get my app to close.

The problem i am having is that endPlot fires WELL BEFORE the document has spooled off to the printer - and so i get no output.

Does anyone have any suggestions??

+1  A: 

Make sure that background plotting is disabled. You can do that either in options or set BACKGROUNDPLOT to 0 from the command prompt.

mohnston
Hi, i have tried what you suggested but the event is still fired at the same time.
Grant
+1  A: 

You could try en-queuing a 2nd plot to a null device and wait for that to finish (or start, as it seems).

Have you looked into simply waiting for the bool return value of object.PlotToDevice [plotConfig] ?

CAD bloke