VB6.0, Batch Plot

VB6.0, Batch Plot

Anonymous
Not applicable
358 Views
3 Replies
Message 1 of 4

VB6.0, Batch Plot

Anonymous
Not applicable
I am trying to do a VB6.0 application for batch plot. The program like this: first. it asks user to choose a sample dwg file. then it records its pc3, papersize, plotarea, scale, rotation,etc,settings. Then it asks user to choose multiple files and does plotting one by one. I have a function doing the last part, plotting, everytime it stucked and shutdowned VB6.0. Please help me find where I missed. Here is the function:

Function DoPlot(ByVal FNM As String)
'connect AutoCAD 2004
Dim oApp As AcadApplication

On Error Resume Next
Set oApp = GetObject(, "AutoCAD.Application.16")
If Err Then
Err.Clear
Set oApp = CreateObject("AutoCAD.Application.16")
End If

If oApp Is Nothing Then
MsgBox "Unable to Connect to Autocad 2004, Please contact AutoCAD Admin.", vbCritical
Exit Function
End If

Dim newDoc As AcadDocument
Set newDoc = oApp.Documents.Open(FNM)

Dim oPC As AcadLayout
Set oPC = newDoc.ActiveLayout
'pc3 name
oPC.ConfigName = strPRTname
'papersize name
oPC.CanonicalMediaName = strPaperSize
'ctb name
oPC.StyleSheet = strCTB
newDoc.Plot.PlotToDevice
newDoc.Close
oApp.Quit


End Function
0 Likes
359 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Try setting the BACKGROUNDPLOT system variable to 0.

Regards - Nathan
0 Likes
Message 3 of 4

Anonymous
Not applicable
AutoCAD 2004 does not have this system variable. I noticed 2006 has.
0 Likes
Message 4 of 4

Anonymous
Not applicable
that is how i got around it.
could you put some kind of 'pause' command that is set long enough for the plot to complete? it's a bit clumsy, but i don't think there is any way of finding out when the plotter has finished
0 Likes