我想用VB编程然后在CAD里面画一个圆,但是总出现实时错误438,求高手~~
Dim AcadApp As AcadApplicationPrivate Sub Command1_Click()
Dim circleObj As AcadCircle
Dim centerpoint(0 To 2) As Double
Dim radius As Double
centerpoint(0) = 20: centerpoint(1) = 30: centerpoint(2) = 0
radius = Val(Text1.Text)
Set circleObj = AcadApp.ActiveDocument.ModelSpace.AddCircle_(centerpoint, radius)
ZoomAll
End Sub
Private Sub Form_Load()
On Error Resume Next
Set AcadApp = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
Set AcadApp = CreateObject("AutoCAD.Application")
If Err Then
MsgBox ("不能运行AutoCAD 2007,请检查是否安装了AutoCAD 2007")
Exit Sub
End If
End If
AcadApp.Visible = True
End Sub