-
- Public Function GetVal(Line1 As AcadLine, Line2 As AcadLine) As Integer
- Dim c As AcadLine
- Dim a(1) As Double, b(1) As Double
- Dim d(2) As Double, e(2) As Double
- If Line1.Angle Line2.Angle Then GetVal = 0: Exit Function
- GetVal = 1
- e(1) = 1
- Set c = ThisDrawing.ModelSpace.AddLine(d, e)
- If c.Angle = Line1.Angle Then
- h = c.StartPoint
- h(0) = h(0) + 1
- c.StartPoint = h
- End If
- f = c.IntersectWith(Line1, acExtendBoth)
- g = c.IntersectWith(Line2, acExtendBoth)
- c.Delete
- If Abs(f(0) - g(0)) Value1 Then Max = Value2
- End Function
这是一个判断两直线是否平行且重合的程序不平行返回0平行但不在一直线上返回1平行且在一直线上但不相交返回2平行且在一直线上且相交返回3下一步应该简单了吧 |