Intersection

Intersection

JL_Menegotto01
Explorer Explorer
496 Views
1 Reply
Message 1 of 2

Intersection

JL_Menegotto01
Explorer
Explorer

I´m using the method below in order to calculate the intersections points in a set of structural grids.

The grids are divided in a list of horizontal grids (Eixos[0]) and a list of vertical grids (Eixos[1]), separatly) 

I put all the intersections in a Lpti.

 

It´s working OK with a set of ortogonal grid lines, but when one of the grid lines is not orthogonal the IntersectionResult fails.

 

Thank You

 

 

public List<XYZ> Interseccion_Ejes(List<List<Grid>> Eixos)

{

List<XYZ> Lpti = new List<XYZ> { };

for (int i = 0; i < Eixos[0].Count; i++)

{

Curve c1 = Eixos[0].ElementAt(i).Curve;

for (int j = 0; j < Eixos[1].Count; j++)

{

Curve c2 = Eixos[1].ElementAt(j).Curve;

IntersectionResultArray results;

SetComparisonResult result = c1.Intersect(c2, out results);

IntersectionResult iResult = results.get_Item(0);

Lpti.Add(iResult.XYZPoint);

}

}

return Lpti;

}

 

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

jeremytammik
Autodesk
Autodesk

Dear JL_Menegotto01,

 

Thank you for your query.

 

I do not see any obvious problem with your code.

 

Without any additional information or possibility to reproduce the problem, there is not really anything else I can say directly.

 

If all you are after are the intersection points, you might consider using a more light-weight implementation than the Intersect method provided by the Revit API.

 

After all, if your grid lines are just straight lines, and if they are horizontal, this is just a calculation of bounded line segment intersections in the XY plane.

 

We looked at the topic of unbounded line intersection in the XY plane only recently on The Building Coder, for the exact same use case:

 

http://thebuildingcoder.typepad.com/blog/2015/05/connecting-desktop-cloud-lines-and-grid-segments.ht...

 

http://thebuildingcoder.typepad.com/blog/2015/05/geometry-creation-and-line-intersection-exceptions....

 

Maybe that will be useful for you as well.

 

If you wish to resolve your original issue using the Revit API Intersect method, I would suggest submitting a reproducible case for testing:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

 

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes