jrice174
Civil/Environmental
- Nov 8, 2004
- 129
I'm attempting to find the insersection of two lines and store that points X and Y in an array before putting it in a spreadsheet. I can't figure out how to get the X and Y coordinates from the Intersection point. Below is the code I'm using.
Dim FirstLine As AcadLine
Dim SecondLine As AcadLine
Dim ThirdLine As AcadLine
Dim IntersectionPt As Variant
Set FirstLine = ThisDrawing.ModelSpace.AddLine(Pt1, Pt2)
Set SecondLine = ThisDrawing.ModelSpace.AddLine(Pt3, Pt4)
IntersectionPt = FirstLine.IntersectWith(SecondLine, acExtendBoth)
What I've tried is:
X1 = IntersectionPt(0): Y1 = IntersectionPt(1)
but it doesn't work. Any suggestions?
Dim FirstLine As AcadLine
Dim SecondLine As AcadLine
Dim ThirdLine As AcadLine
Dim IntersectionPt As Variant
Set FirstLine = ThisDrawing.ModelSpace.AddLine(Pt1, Pt2)
Set SecondLine = ThisDrawing.ModelSpace.AddLine(Pt3, Pt4)
IntersectionPt = FirstLine.IntersectWith(SecondLine, acExtendBoth)
What I've tried is:
X1 = IntersectionPt(0): Y1 = IntersectionPt(1)
but it doesn't work. Any suggestions?