
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I am kind of confused using the IntersectWith method. It is working just like I thought, if my 2 AcadLines cross. But if they overlie (look at coords) it doesn't detect it as I wish. So I wanna know if it's about the IntersectWith method or more likely my code. I am thankful for any help or ideas to solve my issue.
Sub Intersection()
Dim line(9) As AcadLine
Dim startp(2) As Double
Dim endp(2) As Double
startp(0) = 0
startp(1) = 0
endp(0) = 30
endp(1) = 0
Set line(0) = ThisDrawing.ModelSpace.AddLine(startp, endp)
startp(0) = 20
startp(1) = 0
endp(0) = 50
endp(1) = 0
Set line(1) = ThisDrawing.ModelSpace.AddLine(startp, endp)
Dim intPoints As Variant
intPoints = line(1).IntersectWith(line(0), acExtendNone)
If UBound(intPoints) = -1 Then
Debug.Print "intersection point not existing"
Else
Debug.Print "intersection point existing"
End If
End Sub
Solved! Go to Solution.