.NET

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

printing multiple drawings in VB

103 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 (103 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 (103 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.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community