我的代码如下,(附图如附件): Public Sub FindIntersect() Dim e11 As AcadEntity Dim e22 As AcadEntity Dim intPoints As Variant Set e11 = ThisDrawing.ModelSpace(0) Set e22 = ThisDrawing.ModelSpace(1) intPoints = e11.IntersectWith(e22, acExtendNone) Dim i As Integer Dim j As Integer Dim k As Integer Dim str As String
If VarType(intPoints) <> vbEmpty Then For i = LBound(intPoints) To UBound(intPoints) str = "Intersection Point[" & k & "] is: " & intPoints(j) & "," & intPoints(j + 1) & "," & intPoints(j + 2) MsgBox str, , "IntersectWith Example" str = "" i = i + 2 j = j + 3 k = k + 1 Next End If End Sub
附图中的两个图元明明是有交点的啊,为什么显示不出交点的坐标呢? |