.NET

Reply
Contributor
sean_hando
Posts: 15
Registered: ‎11-19-2003
Message 1 of 3 (111 Views)

printing multiple drawings in VB

111 Views, 2 Replies
09-22-2005 01:18 PM
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.
Distinguished Contributor
NathTay
Posts: 1,691
Registered: ‎12-15-2003
Message 2 of 3 (111 Views)

Re: printing multiple drawings in VB

09-22-2005 04:00 PM 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
Contributor
sean_hando
Posts: 15
Registered: ‎11-19-2003
Message 3 of 3 (111 Views)

Re: printing multiple drawings in VB

09-22-2005 04:13 PM in reply to: sean_hando
Holy cow, that's so simple. It works perfectly.

Thank you for the tip.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.