 - Public Sub test()
- Dim obj As AcadLine
- Dim a As Object
- Dim pnt1(2) As Double, pnt2(2) As Double
- pnt2(1) = 20
- pnt2(0) = 0
- Set obj = ThisDrawing.ModelSpace.AddLine(pnt1, pnt2)
- ThisDrawing.Utility.GetEntity a, pnt
- b = obj.IntersectWith(a, acExtendBoth)
- If UBound(b) = 2 Then
- Debug.Print b(0) & "," & b(1)
- Else
- Debug.Print "无交点"
- End If
- End Sub
|