此段程序在r14时使用正常,r2004中修改了版本类型,可打开r2004的程序,却无法打开
图形,也不提示出错,不知为何?请斑竹指教
On Error Resume Next
Set acadapp = GetObject(, "AutoCAD.application.16")
If Err Then
Err.Clear
Set acadapp = CreateObject("AutoCAD.application.16")
If Err Then
MsgBox Err.Description
Exit Sub
End If
End If
Set acaddoc = acadapp.activedocument
acadapp.Activate
acadapp.Application.Visible = True
acadapp.Windows(1).Visible = True
acaddoc.open (c:\1.dwg)
我的这段没有什么问题,你参考参考吧
On Error Resume Next
Set acadapp = GetObject(, "AutoCAD.application")
If Err Then
Err.Clear
Set acadapp = CreateObject("AutoCAD.application")
If Err Then
MsgBox Err.Description
Exit Sub
End If
End If
Set acaddoc = acadapp.activedocument
For i = 0 To File1.ListCount - 1 Step 1
If File1.Selected(i) Then '对列表文件进行处理
a = Path + File1.List(i)
File1.Selected(i) = False
acaddoc.apen a
acaddoc.activeviewport.zoomall
acaddoc.purgeall
acaddoc.purgeall
acaddoc.purgeall
acaddoc.purgeall
acaddoc.purgeall
MkDir "d:\jianfei"
acaddoc.saveas "d:\jianfei\" & File1.List(i) & ".dwg"