Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public static XYZ Intersection(this Autodesk.Revit.DB.Plane plane, Autodesk.Revit.DB.Line line)
UV uv1, uv2;
plane.Project(line.Origin, out uv1, out double d);
plane.Project(line.Origin + line.Direction, out uv2, out double b);
XYZ xyz1 = plane.Origin + (uv1.U * plane.XVec) + (uv1.V * plane.YVec);
XYZ xyz2 = plane.Origin + (uv2.U * plane.XVec) + (uv2.V * plane.YVec);
Line projectedLine = Line.CreateUnbound(xyz1, xyz2 - xyz1);
IntersectionResultArray iResult = new IntersectionResultArray();
SetComparisonResult setComparisonResult = line.Intersect(projectedLine, out iResult);
if (setComparisonResult != SetComparisonResult.Disjoint)
return iResult.get_Item(0).XYZPoint;
return null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.