Get elements according to their position in Revit model using dynamo

In my drawings in Revit are wall constructions and modeled screws. So far I have not found a solution to integrate these into my walls.
Do you have an idea how I can output the screws and wall constructions together according to their spatial position in the Revit model? So if they are adjacent neighbors, they are exported together.

Are the screws 3D? If so comparison to the result of a Geometry.DistanceTo would work as a filter method. Element.Intersects could also work as a filter. Personally I hope they aren’t as this is almost certainly over modeling, and everything will be slow (including running this graph).

If they are annotations in a 2D detail view you could use an all elements in view method and apply the distance to comparison there (will be much faster as you’ll only have a handful of walls and screws).

Dear Jacob,

thank you for your help!
In fact, the screws are in 3D. I have imported these from the manufacturer.

Element.Intersects worked, but unfortunately not yet as I would like. I have generally selected that all elements touching walls should be output to me. This works, but it is not obvious to which wall they belong:

I found this example, that seems to be the solution. But still when I try this, the elements are not output according to the associated walls.

Maybe you notice a mistake in my script or have an idea.

Dear @jacob.small

I now tried to use geometry.distanceto but it still doesn’t work. I want to have all elements and their neighbours…do you have any other suggestions or ideas?

This is the path I would take, and the issue isn’t really clear to me as I don’t have your data set. Can you post a sample containing five walls and the associated screws? Purge all but one view, all materials, families and the like.

@jacob.small

grafik

As you can see on the graphic, I have different wall layery and two srews for examples. Now I want a node which gives me the layers that are connected or touched by the screw. This should then be possible via the geometric position, or?

If you want the layers of the wall you need to access those layers as individual elements (they don’t exist that way by default - you’ll have to make parts of them in Revit and test the screws for intersection with the parts instead of the walls) or by doing some geometry creation (Element.Solids as a start, then offset the wall’s location by the relative thicknesses and extend them by 2x the thickness, then extrude the lines by the wall’s height and build a polysurface, then split the solid with the planes, and finally map the material to the relevant solids - this will give you a hint at the geometry, but not the elements as those don’t exist).

Really can’t help any more than that here without the model and what you’ve tried in Dynamo being posted.

@jacob.small
Thank you very much for your help. Do I understand correctly that I need to create them as individual elements and that they cannot be part of the wall?
So far I have divided the wall into partial elements.

If you divided the wall into parts, ask the screw what parts they touch rather than what walls they touch.

Posting a file is the only way you’re going to get more clarity as I can’t see what you’ve done.

My Revit file is too big for uploading here. Is there a possibility to send it via email?

Delete everything other than five walls and the associated screws. Then delete all views but one new 3d view. Then purge unused 3 times. This will get the file to an uploadable size. Alternatively you can use another service like dropbox, google drive, box, or the like.

Good morning @jacob.small,

did the download work?

Thank you and best wishes