.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

printing multiple drawings in VB

2 REPLIES 2
Reply
Message 1 of 3
sean_hando
288 Views, 2 Replies

printing multiple drawings in VB

I'm trying to create an executable application using Visual Basic that reads a database to open drawings and create a DWF file for each. The problem I'm having is that after the first drawing is opened, printed, and closed, the second fails to print because, it's my belief, the first drawing is still printing in the background. Here's the code I'm using....

objAutoCADDocs.Open(filelocation)

objAutoCADDoc = objAutoCADApp.ActiveDocument

objAutoCADDoc.PaperSpace.Layout.PlotType = AcPlotType.acExtents
objAutoCADDoc.PaperSpace.Layout.StandardScale = AcPlotScale.acScaleToFit
objAutoCADDoc.PaperSpace.Layout.CenterPlot = True
objAutoCADDoc.PaperSpace.Layout.ConfigName = "DWF6 ePlot.pc3"
objAutoCADDoc.Plot.PlotToFile(plotname)

objAutoCADDoc.Close()

objAutoCADDocs.Open(filelocation)

objAutoCADDoc = objAutoCADApp.ActiveDocument

objAutoCADDoc.PaperSpace.Layout.PlotType = AcPlotType.acExtents
objAutoCADDoc.PaperSpace.Layout.StandardScale = AcPlotScale.acScaleToFit
objAutoCADDoc.PaperSpace.Layout.CenterPlot = True
objAutoCADDoc.PaperSpace.Layout.ConfigName = "DWF6 ePlot.pc3"
objAutoCADDoc.Plot.PlotToFile(plotname)

objAutoCADDoc.Close()

Where the code fails is at the second instance of PlotToFile. Like I mentioned above, I'm thinking that the first drawing is still printing in the background. I've tried using a do while loop, checking IsQuiescent, but this doesn't work.

Any help would be appreciated.
2 REPLIES 2
Message 2 of 3
NathTay
in reply to: sean_hando

At the beginning record the BACKGROUNDPLOT system variable and then set it to 0. At the end reset the variable to its original state.

Regards - Nathan
Message 3 of 3
sean_hando
in reply to: sean_hando

Holy cow, that's so simple. It works perfectly.

Thank you for the tip.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost