Private Sub Command1_Click()
Dim ACADApp As AcadApplication
On Error Resume Next
Set ACADApp = GetObject(, "autocad.application")
If Err Then
Err.Clear
Set ACADApp = CreateObject("autocad.application")
If Err Then
MsgBox ("不能运行Autocad,请检查是否安装了autocad")
Exit Sub
End If
End If
acadspp.Visible = ture
End Sub
Dim ACADApp As AcadApplication
On Error Resume Next
Set ACADApp = GetObject(, "autocad.application")
If Err Then
Err.Clear
Set ACADApp = CreateObject("autocad.application")
If Err Then
MsgBox ("不能运行Autocad,请检查是否安装了autocad")
Exit Sub
End If
End If
acadspp.Visible = ture
End Sub
’下面的代码则不要引用AutoCAD就能编译,点击按钮直接运行AutoCAD。
Private Sub Command1_Click()
Dim acadApp As Object
Dim acadDoc As Object
On Error Resume Next
Set acadApp = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
Set acadApp = CreateObject("AutoCAD.Application")
If Err Then End
End If
acadApp.Visible = True
Set acadDoc = acadApp.ActiveDocument
End Sub
Dim acadApp As Object
Dim acadDoc As Object
On Error Resume Next
Set acadApp = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
Set acadApp = CreateObject("AutoCAD.Application")
If Err Then End
End If
acadApp.Visible = True
Set acadDoc = acadApp.ActiveDocument
End Sub
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |