Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get touching elements

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
shehab_fekry
261 Views, 4 Replies

Get touching elements

I want to get the slabs that are on the edge of a beam as shown in figure .. is there any way that I can get these slabs

using ElementIntersectsElement or ElementIntersectsSolid won't work on this case.

 

shehab_fekry_0-1693213954786.png

 

4 REPLIES 4
Message 2 of 5

You should be able to use ElementIntersectsSolid with a slightly enlarged solid.

  

If your beam is aligned with one of the cardinal axes, you could even use a BoundingBoxIntersectsFilter instead, which is a quick filter. Just make the bounding box a bit bigger than the beam.

  

If worst comes to worst, you can also use the ReferenceIntersector to shoot rays from the beam to detect the neighbouring slab.

    

Finally, though, and best of all, we have an 11-year old solution to this very problem by The Building Coder:

  

https://thebuildingcoder.typepad.com/blog/2012/09/filter-for-touching-beams-using-solid-intersection...

  

Please let us know how you end up solving this in your specific case. Thank you!

  

Jeremy Tammik, Developer Advocacy and Support, The Building Coder, Autodesk Developer Network, ADN Open
Message 3 of 5
shehab_fekry
in reply to: shehab_fekry

Thank you, that solution helped a lot I made a solution where I used location line and with some transform functions and using solid.IntersectsWithCurve method I retrieved the slabs.

Message 4 of 5

Very glad to hear that you found a viable solution. Thank you for your appreciation.

  

Jeremy Tammik, Developer Advocacy and Support, The Building Coder, Autodesk Developer Network, ADN Open
Message 5 of 5

Thank you also for sharing your solution. I added it to the blog for future reference:

  

https://thebuildingcoder.typepad.com/blog/2023/10/no-geometry-touching-geometry-and-cut-geometry.htm...

  

Jeremy Tammik, Developer Advocacy and Support, The Building Coder, Autodesk Developer Network, ADN Open

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Customer Advisory Groups


Rail Community