Arizona 发表于 2006-7-24 11:52:02

Re-order a batch process

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?
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

Arizona 发表于 2006-7-24 11:58:18

Try this
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 发表于 2006-7-24 12:05:12

That was perfect! Thanks Bob!
页: [1]
查看完整版本: Re-order a batch process