Line.Intersect(Curve, IntersectionResultArray) expects Curve as second parameter

Line.Intersect(Curve, IntersectionResultArray) expects Curve as second parameter

TYeeH8GW6
Explorer Explorer
690 Views
2 Replies
Message 1 of 3

Line.Intersect(Curve, IntersectionResultArray) expects Curve as second parameter

TYeeH8GW6
Explorer
Explorer

Hi,

 

I've been making a function to detect line intersections with other lines via Line.Intersect(Curve,IntersectionResultArray) function however the function expects a Curve type as the second parameter.

 

from Autodesk.Revit import DB
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *

 

        NewPoint1 = XYZ(P2.X, (P2.Y+P1.Y)/2, P1.Z)
        NewPoint2 = XYZ(150,(P2.Y+P1.Y)/2,P1.Z)
        L1 = Line.CreateBound(NewPoint1,NewPoint2)
 
        resultArray = clr.Reference[IntersectionResultArray]()
        Overlap = Line.Intersect(L1, resultArray)
        if Overlap == SetComparisonResult.Overlap:
           print("Lines Overlap")

 

Any help would be appreciated.

 

Cheers,

Tyson

0 Likes
Accepted solutions (2)
691 Views
2 Replies
Replies (2)
Message 2 of 3

pyaezoneas
Contributor
Contributor
Accepted solution

I think you are supposed to intersect one curve(line) with another.
it should be
L1.Intersect(L2, resultArray)
Now, you aren't intersecting your L1 with anything else.

Message 3 of 3

moturi.magati.george
Autodesk
Autodesk
Accepted solution

Hi @TYeeH8GW6,

 

You can also have a look at the blog post and forum response below for more information about your question.

https://jeremytammik.github.io/tbc/a/0399_find_element_intersection.htm
https://forums.autodesk.com/t5/revit-api-forum/get-point-from-curve-intersection/td-p/10864795

  Moturi George,     Developer Advocacy and Support,  ADN Open