Author Topic: Re-order a batch process  (Read 2041 times)

0 Members and 1 Guest are viewing this topic.

Arizona

  • Guest
Re-order a batch process
« on: July 24, 2006, 11:52:02 AM »
Using the old vbdesign batch process, is there a way that I can capture the listing of files and re-order them bottom to top?
Code: [Select]
Public Sub OpenAndProcessAllDrawings()
  Dim objSelSet As AcadSelectionSet
  Dim objDoc As AcadDocument
  Dim objSearch As New vbdSearch
  Dim objEnt As AcadEntity
  Dim colFiles As New Collection
  Dim strFolder As String
  Dim intCnt As Integer
  Dim strName As String
  On Error GoTo Err_Control
  strFolder = objSearch.ReturnFolder '(0&)
  If Len(strFolder) > 0 Then
    FindFile colFiles, strFolder, "dwg"
    For intCnt = 1 To colFiles.count
      Set objDoc = OpenAnyMode(colFiles(intCnt))
        ThisDrawing.PurgeAll
        BorderBlk
      objDoc.Close
    Next intCnt
  End If
Exit_here:
  Exit Sub
Err_Control:
  MsgBox Err.Description
  Resume Exit_here
End Sub
« Last Edit: July 24, 2006, 12:54:41 PM by CmdrDuh »

Bob Wahr

  • Guest
Re: Re-order a batch process
« Reply #1 on: July 24, 2006, 11:58:18 AM »
Try this
Code: [Select]
Public Sub OpenAndProcessAllDrawings()
  Dim objSelSet As AcadSelectionSet
  Dim objDoc As AcadDocument
  Dim objSearch As New vbdSearch
  Dim objEnt As AcadEntity
  Dim colFiles As New Collection
  Dim strFolder As String
  Dim intCnt As Integer
  Dim strName As String
  On Error GoTo Err_Control
  strFolder = objSearch.ReturnFolder '(0&)
  If Len(strFolder) > 0 Then
    FindFile colFiles, strFolder, "dwg"
    For intCnt = colFiles.count To 1 step -1
      Set objDoc = OpenAnyMode(colFiles(intCnt))
        ThisDrawing.PurgeAll
        BorderBlk
      objDoc.Close
    Next intCnt
  End If
Exit_here:
  Exit Sub
Err_Control:
  MsgBox Err.Description
  Resume Exit_here
End Sub

Arizona

  • Guest
Re: Re-order a batch process
« Reply #2 on: July 24, 2006, 12:05:12 PM »
That was perfect! Thanks Bob! :-)

Bob Wahr

  • Guest
Re: Re-order a batch process
« Reply #3 on: July 24, 2006, 12:07:19 PM »
:-)