乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 52|回复: 2

Re-order a batch process

[复制链接]

16

主题

168

帖子

39

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
197
发表于 2006-7-24 11:52:02 | 显示全部楼层 |阅读模式
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?
  1. Public Sub OpenAndProcessAllDrawings()
  2.   Dim objSelSet As AcadSelectionSet
  3.   Dim objDoc As AcadDocument
  4.   Dim objSearch As New vbdSearch
  5.   Dim objEnt As AcadEntity
  6.   Dim colFiles As New Collection
  7.   Dim strFolder As String
  8.   Dim intCnt As Integer
  9.   Dim strName As String
  10.   On Error GoTo Err_Control
  11.   strFolder = objSearch.ReturnFolder '(0&)
  12.   If Len(strFolder) > 0 Then
  13.     FindFile colFiles, strFolder, "dwg"
  14.     For intCnt = 1 To colFiles.count
  15.       Set objDoc = OpenAnyMode(colFiles(intCnt))
  16.         ThisDrawing.PurgeAll
  17.         BorderBlk
  18.       objDoc.Close
  19.     Next intCnt
  20.   End If
  21. Exit_here:
  22.   Exit Sub
  23. Err_Control:
  24.   MsgBox Err.Description
  25.   Resume Exit_here
  26. End Sub
回复

使用道具 举报

16

主题

168

帖子

39

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
197
发表于 2006-7-24 11:58:18 | 显示全部楼层
Try this
  1. Public Sub OpenAndProcessAllDrawings()
  2.   Dim objSelSet As AcadSelectionSet
  3.   Dim objDoc As AcadDocument
  4.   Dim objSearch As New vbdSearch
  5.   Dim objEnt As AcadEntity
  6.   Dim colFiles As New Collection
  7.   Dim strFolder As String
  8.   Dim intCnt As Integer
  9.   Dim strName As String
  10.   On Error GoTo Err_Control
  11.   strFolder = objSearch.ReturnFolder '(0&)
  12.   If Len(strFolder) > 0 Then
  13.     FindFile colFiles, strFolder, "dwg"
  14.     For intCnt = colFiles.count To 1 step -1
  15.       Set objDoc = OpenAnyMode(colFiles(intCnt))
  16.         ThisDrawing.PurgeAll
  17.         BorderBlk
  18.       objDoc.Close
  19.     Next intCnt
  20.   End If
  21. Exit_here:
  22.   Exit Sub
  23. Err_Control:
  24.   MsgBox Err.Description
  25.   Resume Exit_here
  26. End Sub
回复

使用道具 举报

16

主题

168

帖子

39

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
197
发表于 2006-7-24 12:05:12 | 显示全部楼层
That was perfect! Thanks Bob!
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-7-6 03:09 , Processed in 0.730454 second(s), 58 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表