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

AutoCAD Bogging Down During Long Batch Process

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
406 Views, 4 Replies

AutoCAD Bogging Down During Long Batch Process

I've got a vb.net app that processes a list of drawings for updating,
plotting or saving. If I load it with about 20 drawings, it is pretty
quick - about 10-20 seconds to open and process a drawing. If I load it
with say, 75 drawings, once it get to 25-30, it starts to lose steam. Around
the 40th drawing it is taking 3-4 minutes to process a drawing.

Watching the command line I see that most of the code sent to AutoCAD
completes, then there is a long pause before finishing with a plot or save
command. During this pause, there is no HD activity, no CPU or memory spike
that I can see. It just sits there. So I'm wondering if there is some kind
of AutoCAD "cache" I should be flushing during my loops to keep the lag time
down.

If anyone has any ideas, I'd sure appreciate hearing them!

Thanks!

Oh: AutoCAD 2005, Windows XP Pro, 2GB RAM, P43.0 (DC), 80GB 10kRPM hard
drive...
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

Lets see some code. Can't really dubug otherwise.
--
Regards,
Tim
http://tjriley.infogami.com/pyacaddotnet


"pkirill" wrote in message
news:5176042@discussion.autodesk.com...
I've got a vb.net app that processes a list of drawings for updating,
plotting or saving. If I load it with about 20 drawings, it is pretty
quick - about 10-20 seconds to open and process a drawing. If I load it
with say, 75 drawings, once it get to 25-30, it starts to lose steam. Around
the 40th drawing it is taking 3-4 minutes to process a drawing.

Watching the command line I see that most of the code sent to AutoCAD
completes, then there is a long pause before finishing with a plot or save
command. During this pause, there is no HD activity, no CPU or memory spike
that I can see. It just sits there. So I'm wondering if there is some kind
of AutoCAD "cache" I should be flushing during my loops to keep the lag time
down.

If anyone has any ideas, I'd sure appreciate hearing them!

Thanks!

Oh: AutoCAD 2005, Windows XP Pro, 2GB RAM, P43.0 (DC), 80GB 10kRPM hard
drive...
Message 3 of 5
Anonymous
in reply to: Anonymous

Also you might want to look into this thread for some insight.

http://www.theswamp.org/index.php?topic=6292.0

--
Regards,
Tim
http://tjriley.infogami.com/pyacaddotnet


"pkirill" wrote in message
news:5176042@discussion.autodesk.com...
I've got a vb.net app that processes a list of drawings for updating,
plotting or saving. If I load it with about 20 drawings, it is pretty
quick - about 10-20 seconds to open and process a drawing. If I load it
with say, 75 drawings, once it get to 25-30, it starts to lose steam. Around
the 40th drawing it is taking 3-4 minutes to process a drawing.

Watching the command line I see that most of the code sent to AutoCAD
completes, then there is a long pause before finishing with a plot or save
command. During this pause, there is no HD activity, no CPU or memory spike
that I can see. It just sits there. So I'm wondering if there is some kind
of AutoCAD "cache" I should be flushing during my loops to keep the lag time
down.

If anyone has any ideas, I'd sure appreciate hearing them!

Thanks!

Oh: AutoCAD 2005, Windows XP Pro, 2GB RAM, P43.0 (DC), 80GB 10kRPM hard
drive...
Message 4 of 5
Anonymous
in reply to: Anonymous

That's a great thread. I'll have to take a close look, though as at first
pass it's over my head. Below I've pasted the portion of the code that
handles the looping. It's probably a mess, and I apologize for that... I'd
be thrilled to send you the entire project, but woulnd't want to impose.

As always, any help is appreciated!


Private Sub Plot_Only()
ResetProgress()
frmDLPlot.frmProgressForm.Show()
ReDim strDwgs(UBound(frmDLP.ardwgs2) - 1)
ReDim Preserve frmDLP.FinFileName(UBound(frmDLP.ardwgs2) - 1)
ReDim Preserve strDwgNumber(frmDLP.lstDrawings.Items.Count - 1)
Dim i As Integer = 0
Dim itemChecked As Object
'dwg.SetVariable("SDI", 1)
For i = 0 To UBound(frmDLP.ardwgs2) - 1
System.Windows.Forms.Application.DoEvents() 'check for outside event - ie.
CANCEL button click
If blnProgressCancel = True Then 'If the Cancel button is clicked then goto
EOF2
GoTo EOF2
Else
If InStrLast(frmDLP.FinFileName(i), "_") > 1 _
And loadini.blnDullesSpecial Then
loadini.blnDullesSpecialAutoCreate = True
Else : loadini.blnDullesSpecialAutoCreate = False
End If
' If Len(strFileName) > 0 Then
' otherwise process the drawing fro plotting
'PlotScale = loadini.strPlotScaleList(i) 'get the plot scale from the
loadini subr
'strFileName = loadini.strDrawingNameList(i) 'get the file name from the
loadini subr
PlotScale = frmDLP.FinPlotScale(i)
strFileName = frmDLP.FinFileName(i)
frmDLPlot.frmProgressForm.lblStatusDwgName.Text = strFileName
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Opening"
frmDLPlot.frmProgressForm.Update()
strDwgs(i) = loadini.strFilePath & strFileName & ".dwg" 'add the path and
".dwg"
If InStrLast(frmDLP.FinFileName(i), "_") = 1 _
And loadini.blnDullesSpecial Then
strDwgs(i) = loadini.strCompositeFilePath & strFileName & ".dwg"
End If
' If frmDLP.lstDrawings.GetItemChecked(i) = True Then 'See if the item is
checked and if so
If System.IO.File.Exists(strDwgs(i)) Then 'verify the drawing exists
If loadini.blnDullesSpecialAutoCreate = True Then
'If the file name has an underscore not in the first position
'"_" AND it is a dulles autocreate file then
Try
System.IO.File.Delete(strDwgs(i)) 'try to delete the file
Catch 'if it's open,
blnShowErrMessage = True 'add a line to the error message to be displayed at
the end
strFileErrorMsg = strFileErrorMsg & vbCr & frmDLP.FinFileName(i) & "
*OPENFILE*"
GoTo PLOTNEXT 'then move on to he next file
End Try 'end check for open dulles file
dwg = acad.Documents.Add(strDwgs(i)) 'if the file was deleted, create a new
file with the same name
acad.WindowState = AcWindowState.acMax 'maximize autocad
acad.ActiveDocument.WindowState = AcWindowState.acMax 'maximize the document
Else
AutoCADcommandRunning:
Try
dwg = acad.Documents.Open(strDwgs(i), False)
Catch ex As Exception
' Check for error message...
If ex.Message = "Call was rejected by callee." Then
acad.Visible() = True
MsgBox("**There is an active command in AutoCAD**" & vbCr & vbCr & _
"Click into AutoCAD and cancel the current AutoCAD command." & vbCr & vbCr &
_
"THEN return here press OK to continue the Batch Process",
MsgBoxStyle.Exclamation, "AutoCAD Busy")
GoTo AutoCADcommandRunning
End If
End Try
'if it is not a dulles SHEET drawing, just open it
acad.WindowState = AcWindowState.acMax 'maximize autocad
acad.ActiveDocument.WindowState = AcWindowState.acMax 'maximize the document
End If 'END IF loadini.blnDullesSpecial

ElseIf System.IO.File.Exists(strDwgs(i)) = False And
loadini.blnDullesSpecial Then 'otherwise if the file does not exist and is a
dulles sheet file
'MsgBox(strDwgs(i))
dwg = acad.Documents.Add(strDwgs(i)) 'just create it
acad.WindowState = AcWindowState.acMax 'maximize autocad
acad.ActiveDocument.WindowState = AcWindowState.acMax 'maximize the document
ElseIf System.IO.File.Exists(strDwgs(i)) = False And
loadini.blnDullesSpecial = False Then 'and finally, if the drawing does not
exist and it is not a dulles drawing, skip it,
blnShowErrMessage = True 'adding a line to the error message
strFileErrorMsg = strFileErrorMsg & vbCr & frmDLP.FinFileName(i) & " *NOT
FOUND*"
GoTo PLOTNEXT 'and goto the next drawing
End If 'END If System.IO.File.Exists(strDwgs(i))
'NEW DULLES DRAWING PROCESSING
If loadini.blnDullesSpecialAutoCreate = True And loadini.blnDullesSpecial
Then
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Creating Dulles Sheet"
frmDLPlot.frmProgressForm.Update()
dwg.SendCommand("(load ""NewDullesDwgCheck"")" & vbCr & "(NewDullesDwgCheck
" & """" & _
loadini.strCommission & """" & " " & """" & frmDLP.FinFileName(i) & """" & "
" & _
"""" & loadini.strDwgDirectory & """" & ")" & vbCr)
End If 'END InStrLast(loadini.strDrawingNameList(i), "_") > 1 And
loadini.blnDullesSpecial Then


'RUN MISC SCRIPTS
If frmDLP.chkDwup.Checked = True And loadini.blnDullesSpecialAutoCreate =
False Then 'Send DwuP command
dwg.SendCommand("dwup" & vbCr)
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Updating Border"
frmDLPlot.frmProgressForm.Update()
End If
If frmDLP.chkSpanner.Checked = True Then 'Send Spanner Update command
dwg.SendCommand("sheetall" & vbCr)
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Updating Spanner"
frmDLPlot.frmProgressForm.Update()
End If
If frmDLP.chkPurge.Checked = True Then 'Send PUA command
dwg.SendCommand("pua" & vbCr)
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Purging"
frmDLPlot.frmProgressForm.Update()
End If
If frmDLP.chkChgco.Checked = True Then 'Send Chgco command
dwg.SendCommand("chgco" & vbCr)
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Color BYLAYER"
frmDLPlot.frmProgressForm.Update()
End If
If frmDLP.chkZoomExt.Checked = True Then 'Send Zoom Extents
dwg.SendCommand("ze" & vbCr)
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Zooming"
frmDLPlot.frmProgressForm.Update()
End If
If frmDLP.chkAudit.Checked = True Then 'Send Audit Command
dwg.SendCommand("audit" & vbCr & "yes" & vbCr)
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Auditing"
frmDLPlot.frmProgressForm.Update()
End If
If Len(frmDLP.txtRevNum.Text) > 0 Then
If frmDLP.chkShowAllTri.Checked = True Then
strShowAllTri = "Y"
Else : strShowAllTri = "N"
End If
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Handling Revisions"
frmDLPlot.frmProgressForm.Update()
dwg.SendCommand("(revdisplay " & """" & frmDLP.txtRevNum.Text & """" & " " &
"""" & strShowAllTri & """)" & vbCr)
End If
If frmDLP.chkShowAllRev.Checked = True Then
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Handling Revisions"
frmDLPlot.frmProgressForm.Update()
dwg.SendCommand("(ALLREV_T)" & vbCr)
End If
If frmDLP.chkShowNoRev.Checked = True Then
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Handling Revisions"
frmDLPlot.frmProgressForm.Update()
dwg.SendCommand("(ALLREV_F)" & vbCr)
End If

' If Not frmDLP.cboStamps.Text = "No Stamp" Then
strPEStamp = frmDLP.FinPEStamp(i)
PlotWithStamp()
dwg.Regen(AcRegenType.acActiveViewport)
' End If
Dim USERI5 As String = "0"
If frmDLP.chkXrefLog.Checked = True Then
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Logging Xrefs"
frmDLPlot.frmProgressForm.Update()
dwg.Application.LoadDVB("G:\CAD Standards\HCYU
Standards\__HCYU\Lisp\XrefLog.dvb")
dwg.Application.RunMacro("G:\CAD Standards\HCYU
Standards\__HCYU\LISP\XrefLog.dvb!ThisDrawing.MakeXrefLog")
End If
If Not frmDLPlot.strProcess = "OPEN" Then
If frmDLPlot.strProcess = "PLOT" Or frmDLPlot.strProcess = "BOTH" Then
'frmProgress.Update()
DwgPlot(dwg, i) 'Plot this drawing
If frmDLPlot.strProcess = "PLOT" Then
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Closing"
frmDLPlot.frmProgressForm.Update()
dwg.Close(False)
End If
End If
If frmDLPlot.strProcess = "SAVE" Or frmDLPlot.strProcess = "BOTH" Then
'frmProgress.Update()
Dwgsave(dwg, i)
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Closing"
frmDLPlot.frmProgressForm.Update()
dwg.Close(False)
End If
End If
Dim intProgressCount As Integer =
frmDLPlot.frmProgressForm.prgProgress.Value
If Not intProgressCount >= frmDLPlot.frmProgressForm.prgProgress.Maximum
Then
intProgressCount += 1 ' add 1 to progress count
frmDLPlot.frmProgressForm.prgProgress.Value = intProgressCount
frmDLPlot.frmProgressForm.lblDwgProcessed.Text = intProgressCount.ToString
End If
PLOTNEXT:
End If
Next 'i
EOF2:
blnProgressCancel = False
If frmDLPlot.strSaveDest = "ARCHIVE" Then
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Archiving"
Dim objWriter As New System.IO.StreamWriter(frmArch.strArchiveList, True)
frmArch.strArchLog = loadini.strCommission & " , " & frmArch.strArchDesc & "
, " & loadini.strDiscipline & " , " & modBatchProcess.strDate & " , " &
Environ$("username")
objWriter.WriteLine(frmArch.strArchLog)
objWriter.Close()
End If
blnAcState = False
frmDLPlot.frmProgressForm.Hide()
'dwg.SetVariable("SDI", 0)
If blnAcadExist = False And frmDLP.radOpenOnly.Checked = False Then
If frmDLP.blnLeaveOpen = False Then
acad.Quit()
End If
End If

For i = 0 To UBound(frmDLP.arFinDwgList) - 1
frmDLP.arFinDwgList(i) = ""
Next
For i = 0 To UBound(frmDLP.FinPlotScale) - 1
frmDLP.FinPlotScale(i) = ""
Next
For i = 0 To UBound(frmDLP.FinFileNumber) - 1
frmDLP.FinFileNumber(i) = ""
Next
For i = 0 To UBound(frmDLP.FinFileName) - 1
frmDLP.FinFileName(i) = ""
Next
End Sub
Message 5 of 5
Anonymous
in reply to: Anonymous

If you want to feel free to send the entire project to riltim@gmail.com and
I'll take a look at it. I'm hardly a VB.NET pro but maybe I can help. You
also might want to try creating an account and posting over there in the
.NET section of theswamp.org. I know there are several who should be able to
help you there.

--
Regards,
Tim
http://tjriley.infogami.com/pyacaddotnet


"pkirill" wrote in message
news:5176436@discussion.autodesk.com...
That's a great thread. I'll have to take a close look, though as at first
pass it's over my head. Below I've pasted the portion of the code that
handles the looping. It's probably a mess, and I apologize for that... I'd
be thrilled to send you the entire project, but woulnd't want to impose.

As always, any help is appreciated!


Private Sub Plot_Only()
ResetProgress()
frmDLPlot.frmProgressForm.Show()
ReDim strDwgs(UBound(frmDLP.ardwgs2) - 1)
ReDim Preserve frmDLP.FinFileName(UBound(frmDLP.ardwgs2) - 1)
ReDim Preserve strDwgNumber(frmDLP.lstDrawings.Items.Count - 1)
Dim i As Integer = 0
Dim itemChecked As Object
'dwg.SetVariable("SDI", 1)
For i = 0 To UBound(frmDLP.ardwgs2) - 1
System.Windows.Forms.Application.DoEvents() 'check for outside event - ie.
CANCEL button click
If blnProgressCancel = True Then 'If the Cancel button is clicked then goto
EOF2
GoTo EOF2
Else
If InStrLast(frmDLP.FinFileName(i), "_") > 1 _
And loadini.blnDullesSpecial Then
loadini.blnDullesSpecialAutoCreate = True
Else : loadini.blnDullesSpecialAutoCreate = False
End If
' If Len(strFileName) > 0 Then
' otherwise process the drawing fro plotting
'PlotScale = loadini.strPlotScaleList(i) 'get the plot scale from the
loadini subr
'strFileName = loadini.strDrawingNameList(i) 'get the file name from the
loadini subr
PlotScale = frmDLP.FinPlotScale(i)
strFileName = frmDLP.FinFileName(i)
frmDLPlot.frmProgressForm.lblStatusDwgName.Text = strFileName
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Opening"
frmDLPlot.frmProgressForm.Update()
strDwgs(i) = loadini.strFilePath & strFileName & ".dwg" 'add the path and
".dwg"
If InStrLast(frmDLP.FinFileName(i), "_") = 1 _
And loadini.blnDullesSpecial Then
strDwgs(i) = loadini.strCompositeFilePath & strFileName & ".dwg"
End If
' If frmDLP.lstDrawings.GetItemChecked(i) = True Then 'See if the item is
checked and if so
If System.IO.File.Exists(strDwgs(i)) Then 'verify the drawing exists
If loadini.blnDullesSpecialAutoCreate = True Then
'If the file name has an underscore not in the first position
'"_" AND it is a dulles autocreate file then
Try
System.IO.File.Delete(strDwgs(i)) 'try to delete the file
Catch 'if it's open,
blnShowErrMessage = True 'add a line to the error message to be displayed at
the end
strFileErrorMsg = strFileErrorMsg & vbCr & frmDLP.FinFileName(i) & "
*OPENFILE*"
GoTo PLOTNEXT 'then move on to he next file
End Try 'end check for open dulles file
dwg = acad.Documents.Add(strDwgs(i)) 'if the file was deleted, create a new
file with the same name
acad.WindowState = AcWindowState.acMax 'maximize autocad
acad.ActiveDocument.WindowState = AcWindowState.acMax 'maximize the document
Else
AutoCADcommandRunning:
Try
dwg = acad.Documents.Open(strDwgs(i), False)
Catch ex As Exception
' Check for error message...
If ex.Message = "Call was rejected by callee." Then
acad.Visible() = True
MsgBox("**There is an active command in AutoCAD**" & vbCr & vbCr & _
"Click into AutoCAD and cancel the current AutoCAD command." & vbCr & vbCr &
_
"THEN return here press OK to continue the Batch Process",
MsgBoxStyle.Exclamation, "AutoCAD Busy")
GoTo AutoCADcommandRunning
End If
End Try
'if it is not a dulles SHEET drawing, just open it
acad.WindowState = AcWindowState.acMax 'maximize autocad
acad.ActiveDocument.WindowState = AcWindowState.acMax 'maximize the document
End If 'END IF loadini.blnDullesSpecial

ElseIf System.IO.File.Exists(strDwgs(i)) = False And
loadini.blnDullesSpecial Then 'otherwise if the file does not exist and is a
dulles sheet file
'MsgBox(strDwgs(i))
dwg = acad.Documents.Add(strDwgs(i)) 'just create it
acad.WindowState = AcWindowState.acMax 'maximize autocad
acad.ActiveDocument.WindowState = AcWindowState.acMax 'maximize the document
ElseIf System.IO.File.Exists(strDwgs(i)) = False And
loadini.blnDullesSpecial = False Then 'and finally, if the drawing does not
exist and it is not a dulles drawing, skip it,
blnShowErrMessage = True 'adding a line to the error message
strFileErrorMsg = strFileErrorMsg & vbCr & frmDLP.FinFileName(i) & " *NOT
FOUND*"
GoTo PLOTNEXT 'and goto the next drawing
End If 'END If System.IO.File.Exists(strDwgs(i))
'NEW DULLES DRAWING PROCESSING
If loadini.blnDullesSpecialAutoCreate = True And loadini.blnDullesSpecial
Then
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Creating Dulles Sheet"
frmDLPlot.frmProgressForm.Update()
dwg.SendCommand("(load ""NewDullesDwgCheck"")" & vbCr & "(NewDullesDwgCheck
" & """" & _
loadini.strCommission & """" & " " & """" & frmDLP.FinFileName(i) & """" & "
" & _
"""" & loadini.strDwgDirectory & """" & ")" & vbCr)
End If 'END InStrLast(loadini.strDrawingNameList(i), "_") > 1 And
loadini.blnDullesSpecial Then


'RUN MISC SCRIPTS
If frmDLP.chkDwup.Checked = True And loadini.blnDullesSpecialAutoCreate =
False Then 'Send DwuP command
dwg.SendCommand("dwup" & vbCr)
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Updating Border"
frmDLPlot.frmProgressForm.Update()
End If
If frmDLP.chkSpanner.Checked = True Then 'Send Spanner Update command
dwg.SendCommand("sheetall" & vbCr)
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Updating Spanner"
frmDLPlot.frmProgressForm.Update()
End If
If frmDLP.chkPurge.Checked = True Then 'Send PUA command
dwg.SendCommand("pua" & vbCr)
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Purging"
frmDLPlot.frmProgressForm.Update()
End If
If frmDLP.chkChgco.Checked = True Then 'Send Chgco command
dwg.SendCommand("chgco" & vbCr)
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Color BYLAYER"
frmDLPlot.frmProgressForm.Update()
End If
If frmDLP.chkZoomExt.Checked = True Then 'Send Zoom Extents
dwg.SendCommand("ze" & vbCr)
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Zooming"
frmDLPlot.frmProgressForm.Update()
End If
If frmDLP.chkAudit.Checked = True Then 'Send Audit Command
dwg.SendCommand("audit" & vbCr & "yes" & vbCr)
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Auditing"
frmDLPlot.frmProgressForm.Update()
End If
If Len(frmDLP.txtRevNum.Text) > 0 Then
If frmDLP.chkShowAllTri.Checked = True Then
strShowAllTri = "Y"
Else : strShowAllTri = "N"
End If
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Handling Revisions"
frmDLPlot.frmProgressForm.Update()
dwg.SendCommand("(revdisplay " & """" & frmDLP.txtRevNum.Text & """" & " " &
"""" & strShowAllTri & """)" & vbCr)
End If
If frmDLP.chkShowAllRev.Checked = True Then
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Handling Revisions"
frmDLPlot.frmProgressForm.Update()
dwg.SendCommand("(ALLREV_T)" & vbCr)
End If
If frmDLP.chkShowNoRev.Checked = True Then
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Handling Revisions"
frmDLPlot.frmProgressForm.Update()
dwg.SendCommand("(ALLREV_F)" & vbCr)
End If

' If Not frmDLP.cboStamps.Text = "No Stamp" Then
strPEStamp = frmDLP.FinPEStamp(i)
PlotWithStamp()
dwg.Regen(AcRegenType.acActiveViewport)
' End If
Dim USERI5 As String = "0"
If frmDLP.chkXrefLog.Checked = True Then
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Logging Xrefs"
frmDLPlot.frmProgressForm.Update()
dwg.Application.LoadDVB("G:\CAD Standards\HCYU
Standards\__HCYU\Lisp\XrefLog.dvb")
dwg.Application.RunMacro("G:\CAD Standards\HCYU
Standards\__HCYU\LISP\XrefLog.dvb!ThisDrawing.MakeXrefLog")
End If
If Not frmDLPlot.strProcess = "OPEN" Then
If frmDLPlot.strProcess = "PLOT" Or frmDLPlot.strProcess = "BOTH" Then
'frmProgress.Update()
DwgPlot(dwg, i) 'Plot this drawing
If frmDLPlot.strProcess = "PLOT" Then
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Closing"
frmDLPlot.frmProgressForm.Update()
dwg.Close(False)
End If
End If
If frmDLPlot.strProcess = "SAVE" Or frmDLPlot.strProcess = "BOTH" Then
'frmProgress.Update()
Dwgsave(dwg, i)
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Closing"
frmDLPlot.frmProgressForm.Update()
dwg.Close(False)
End If
End If
Dim intProgressCount As Integer =
frmDLPlot.frmProgressForm.prgProgress.Value
If Not intProgressCount >= frmDLPlot.frmProgressForm.prgProgress.Maximum
Then
intProgressCount += 1 ' add 1 to progress count
frmDLPlot.frmProgressForm.prgProgress.Value = intProgressCount
frmDLPlot.frmProgressForm.lblDwgProcessed.Text = intProgressCount.ToString
End If
PLOTNEXT:
End If
Next 'i
EOF2:
blnProgressCancel = False
If frmDLPlot.strSaveDest = "ARCHIVE" Then
frmDLPlot.frmProgressForm.lblStatusProcess.Text = "Archiving"
Dim objWriter As New System.IO.StreamWriter(frmArch.strArchiveList, True)
frmArch.strArchLog = loadini.strCommission & " , " & frmArch.strArchDesc & "
, " & loadini.strDiscipline & " , " & modBatchProcess.strDate & " , " &
Environ$("username")
objWriter.WriteLine(frmArch.strArchLog)
objWriter.Close()
End If
blnAcState = False
frmDLPlot.frmProgressForm.Hide()
'dwg.SetVariable("SDI", 0)
If blnAcadExist = False And frmDLP.radOpenOnly.Checked = False Then
If frmDLP.blnLeaveOpen = False Then
acad.Quit()
End If
End If

For i = 0 To UBound(frmDLP.arFinDwgList) - 1
frmDLP.arFinDwgList(i) = ""
Next
For i = 0 To UBound(frmDLP.FinPlotScale) - 1
frmDLP.FinPlotScale(i) = ""
Next
For i = 0 To UBound(frmDLP.FinFileNumber) - 1
frmDLP.FinFileNumber(i) = ""
Next
For i = 0 To UBound(frmDLP.FinFileName) - 1
frmDLP.FinFileName(i) = ""
Next
End Sub

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