Check for other elements in a radius around elements



im looking for a possibility to check if there are any elements in given a radius around an element.
In this case i have a pile foundation with a admissible minimum distance between each piles, e. g. 5.0 meters.

I reached my target partial with the following script:

I have to select each particular pile and now i’m wondering if there is a possibility to check this automatically for every pile.

I’m also looking for a possibility to check for other elements only in the given radius. At this time the script is checking the distance to every other pile, but in a project with many piles this would be very slow with a bad performance.

Thanks for your thoughts and help.


intersecting geometry and filtering hits based on location of pile your are checking. use the preview in dynamo.
I use some vectors or raybounce to check for elements.