Get touching elements

Get touching elements

shehab_fekry
Enthusiast Enthusiast
4,089 Views
6 Replies
Message 1 of 7

Get touching elements

shehab_fekry
Enthusiast
Enthusiast

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

 

0 Likes
Accepted solutions (1)
4,090 Views
6 Replies
Replies (6)
Message 2 of 7

jeremy_tammik
Alumni
Alumni
Accepted solution

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 7

shehab_fekry
Enthusiast
Enthusiast

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 7

jeremy_tammik
Alumni
Alumni

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 7

jeremy_tammik
Alumni
Alumni

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
0 Likes
Message 6 of 7

cmoodyMNHEU
Observer
Observer

Jeremy's answer works great for curve based elements but I found his other answer here: https://thebuildingcoder.typepad.com/blog/2010/12/find-intersecting-elements.html works very well for all types of elements (curve and point based ex: walls & structural connectors). There are some API updates to perform on each code example he provides (curve based that he originally linked, and bounding box based that I linked here) but the logic is sound and holds up in Revit 2024 API.

0 Likes
Message 7 of 7

kapitalaudio1234
Explorer
Explorer

the discussion is so helpful for me as a beginner ,sorry i just have a little question, getting a slab that is on the edge of a beam can be done in solibri as i know.what could be the difference of getting it with revit api or solibri ?

0 Likes