Select Elements Having distance smaller than 400mm

I tried to get get the length between 2 elements and got them also but how do I select those elements?
in the image below I have a list of bool where 2 elements are true I tried filtering by bool mask but not working.

@jazzsharma200 ,

you can go straight forward with DesignScript…

But distance between two elements is not a parameter

1 Like

image

You didn’t feed anything to list (based on true or false).

@jazzsharma200 ,

this way ?

1 Like

Hi @jazzsharma200 ,

You made some mistakes in the script of your first post, could you send this script so I can make some edits?

I did actually but its not in pic cuz I disconnected cuz if u think there is no relevance between the elements and distance

distance.dyn (20.3 KB)
here it is.

curve.pointatparameter is in which dynamo package?

Seems promising

Quick update I am trying this on ducts family.

I tried but no luck cuz elements are of same family.

Hi @jazzsharma200 ,

See if this helps/works for you:


2022-12-15 FilterRevitElementsIfCloserToEachotherThanX.dyn (20.7 KB)

PS: Just to be clear, this simply filters the elements which have another item closer than X, nothing else.

2 Likes

If you’re dealing with curve based elements and just trying to group elements together which are nearby each other, I suggest looking into grouping them using solids at parameter. This technique also works really well for point based objects. Effectively you can:

  1. Get the location curve of each element
  2. Break it down into points at max spacing
  3. Place a sphere or cuboid at those points
  4. Join them all to one big solid
  5. Separate them (only available in Dynamo for Revit 2022 onwards)
  6. Get the centre point of each curve
  7. Clash with the solids (it will only hit one)
  8. Group by the index of their clash

If you have access to Rhino Inside Revit it is a LOT faster at scale, but I’ve attached both approaches (Dynamo for R22 onwards) and Grasshopper/Rhino Inside. Was working on a similar problem this solves, so happy to share my prototype here.

Clump elements by solids.dyn (31.4 KB)

Note to open this Grasshopper script, change the extension as the forum doesn’t permit gh or gha file extensions:
Clump elements by solids (change dyn to gh).dyn (12.6 KB)

4 Likes

Hi Gavin the problem of selecting elements is resolved but now there is another hurdle combining elements based on close proximity.
one thing i tired was get the element location than on the points of that created solid sphere.
take the geometry of the ducts and than check if sphere is intersecting the ducts.
No. of intersection will depend on how many elements are near to the sphere for instance if there are only 2 elements than a total of 4 intersection will be there one with the duct itself from whose point we created sphere and the other with the neighbouring ducts similarly the same with the other duct.
i cant seem to find any method other than u pointed out and shared script but i m using Revit 2021 so solid.seperate wont work.

Yes unfortunately the solids node from 2022 is the key to grouping the elements in my example scripts.

Another alternative is to pull the spheres down to Z=0, then intersect their union with the XY plane. The intersecting surfaces should be returned disjointed by default and can be used to intersection check the element points as per my example from there.

2 Likes