5007397发表于2005-12-7 9:56:00回复:(5007397)高手求教 请问一下这个子函数怎么才能在VB里面被调用
Public Function AddCir2P(ByVal pt1 As Variant, ByVal pt2 As Variant) As Aca...
Private Sub Command1_Click()
Dim objControl As Control
For Each objControl In form1.Controls
If TypeOf objControl Is TextBox Then
If objControl.Text = "" Then
MsgBox "缺少参数,无法计算!", vbCritical
Exit Sub
End If
End If
Next
On Error Resume Next
Dim pt7(0 To 2) As Double, pt8(0 To 2) As Double
Dim acadApp As AcadApplication
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
Dim acadDoc As AcadDocument
Set acadDoc = acadApp.ActiveDocument
Dim objLine3 As AcadLine
Dim objCircle3 As AcadCircle
pt7(0) = 0
pt7(1) = 0
pt7(2) = 0
pt8(0) = 1000
pt8(1) = 0
pt8(2) = 0
Set objLine3 = acadDoc.ModelSpace.AddLine(pt7, pt8)
Set objCircle3 = acadDoc.ModelSpace.AddCir2P(pt7, pt8)
ZoomAll
End Sub
怎么调用AddCir2P??????????????????? |