- 积分
- 267
- 明经币
- 个
- 注册时间
- 2004-11-16
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
不好意思,我第一次接触这个用VB编CAD
能帮我看一下这个程序
Dim acadapp As AutoCAD.AcadApplication
Private Sub Command1_Click() Call 连接AutoCAD Dim s(2) As Double Dim e(2) As Double s(0) = 0: s(1) = 100: s(2) = 0 e(0) = 0: e(1) = 100: e(2) = 0 Dim a As AutoCAD.AcadLine a = acadapp.ActiveDocument.ModelSpace.addline(s, e) acadapp.ZoomExtents End Sub Public Sub 连接AutoCAD() 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 acadapp.Visible = True acadapp.WindowState = acMax AppActivate (acadapp.Caption) End Sub
运行的时候,它总出问题,怎么回事呢 |
|