How to classify lists based on intersection tolerances - bimorph package

Hi All,

Can anyone help me get sublists which shows intersected elements(indices 0 and 1) separately from elements which didn’t intersect.

Thanks in advance :slight_smile:

You can watch the first 20 seconds of the video here which explains a workflow for the Element.IntersectsElement node that shows how to filter the sets of intersecting elements synchronously. The principles remain the same: connect the output from BoundingBox.GetElementsIntersect to List.IsEmpty, then wire that to the 2 FilterByBoolMask, with one taking the bounding boxes from BoundingBox.ByElement and the other taking the elements from Select Model Elements node. The indexs are always corresponding.

Also, I would suggest using Element.BoundingBox rather than the BoundingBox.ByElement custom node for this as it seems a bit arbitrary. If you do need to use it, then ensure the output of dynamo bounding boxes is 1D (use List.Flatten as a fail-safe if you are not sure) otherwise you’ll end up with an additional (and unecessary) rank from the Bimorph Node.

1 Like

HI Thomas,

Thanks for your reply, I tried to copy the the same logic from video to apply it for Pipes vs Pipes, see image below,

Wall vs Pipes look fine but not for pipes vs pipes intersection.

Can you identify what wrong with my script, thanks in advance :slight_smile:

I basically want to figure out if all the pipes are having a safe clearance (approx 30 mm) value around its surrounding elements. So if 2 pipes are very close to each other I could filter out those pipes separately, this is also for pipes vs other categories.

See image below for more information.

Any suggestions let me know, thanks in advance :slight_smile:


The image above shows ids indexed, according to which the last one in the indices should not appear after being filtered by List.FilterbyBoolMask

But its appearing and I really don’t know why ?

How do I filter out the ones which are intersected,

If you see empty lists then there were no intersections. In the image above, all sublists contain elements which means element intersections were found with all the bounding boxes you input.

Also, you mention that you want to establish which pipes are within a 30mm proximity to other pipes so using bounding boxes are not the way to do this, well, not unless your building is perfectly aligned to Revits internal coordinate system as bounding boxes are always axis-aligned to it and can not be rotated in anyway. It means if your building is rotated, then the bounding box will resize around elements accordingly, but remain constrained to the global XYZ axes. Hence, a 30mm tolerance will pick up elements that may be well in excess of the geometry you are attempting to test. The best thing to do if the above explanation is difficult to understand, is to get the cuboids from the bounding boxes so you can visually see their extents. BoundingBoxes are good as course filters and are not designed for the accuracy one would expect from, say geometry intersections (bounding box intersections are performed against other bounding boxes, not geometry, and this makes them ideal for speed, and optimisation, but are not suitable where precision geometry intersection tests need to be performed).

The BimorphNode Element.IntersectsElement only performs interference checking for hard clashes, it does not support ‘soft’ clashes (i.e. clearance clashes) which is what you require. If you want to perform this type of check using Revit and Dynamo then, your only option to avoid clunky and expensive geometry extraction/scaling is to increase the size of your pipes temporarily and use BimorphNode Element.IntersectsElement to get the results. There are a number of ways of doing this but there are pro’s and con’s with each:

  1. Copy all pipes to a new design option, increase their profile to include the 30mm then perform the clash test
  2. Temporarily increase the size of each pipe in a custom script, perform the intersection test, undo the change and return the result
  3. Use Navisworks or similar and perform the clash test there then import the results to Dynamo. There are a number of resources online for this. Here is one: https://knowledge.autodesk.com/support/revit-products/learn-explore/caas/screencast/Main/Details/9cfe3fad-3432-4d07-9110-c4a14a7af2c4.html

You’ll need to decide which option is best for your workflow.