Line.project returns a point that is not on the line.

Line.project returns a point that is not on the line.

Anonymous
Not applicable
278 Views
1 Reply
Message 1 of 2

Line.project returns a point that is not on the line.

Anonymous
Not applicable

I have a similar function in my code and I assume it will always return 0 - since <p> is on <line>- , but that is not always the case.

can someone help me understand what I am missing.

 

double func(Line line)
{
    // line is unbounded
    XYZ p = line.Project(new XYZ(0, 0, 0)).XYZ;
    return line.Distance(p);
}

 Thank you.

0 Likes
279 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni

Line.Project returns an IntersectionResult

 

I do not see any XYZ property among its members.

 

Should you not be using the XYZPoint property instead?

 

https://www.revitapidocs.com/2022/c33b0518-e0f9-cf50-2d20-41f4e689ba1b.htm

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes