Duct vs Duct Clash Detection

Dear BIMmers,

How do I perform a clash detection between the same category of elements?
I have already created the Dynamo script but it creates a self intersection point as well.
I have only 25 Ducts in a file and have created 4 clashes to check.
But the script shows me 25 + 4 = 29 clashes
I want to perform similar clashes between other MEP elements as well.
Please guide… Any help is highly appreciated

Hello. Can you post your script so we can try to help?

Hi,

To avoid self intersection, you need to divide your list of ducts into two with a selection by worksets or by System Type.

Use BimorphNodes Element.IntersectsElement. It performs ultra-efficient clash detection and automatically prevents self-intersections to support exactly this type of workflow :+1:

4 Likes


The Script has 3 parts

  1. Collecting Ducts
  2. Clash Detection
  3. And placing a marker family

Rest of the script is loose and marker placement is froze

How would I do that when all the elements are same?

Check out @Thomas_Mahon’s BimorphNodes, his should work perfectly for your situation.

Will try… :slight_smile:

Cool… Will try… :slight_smile:

I tried BimorphNodes, but it only list downs the elements involved in the clash.
Hence, I get a list of 8 ducts.
How do I find the clashpoints from this way up.
I was able to get the clash points through the Revit Element Clash Detection Node.
Please guide.

The clash results enable you to devise your own workflow for clash interrogation since the possibilities are effectively endless (Solids, surfaces, points, familyies, spheres, filters, overrides etc, etc, etc) so the Dynamo user needs to decide what is best for their needs.

Here is one workflow you could use/adapt accordingly:

Hi Thomas,

Everything is fine with the clashes except one thing that it also includes the ducts that are not physically involved in any clash (This is because it detects self intersection). My two set of elements are same i.e. Ducts
I hope I was able to explain my issue.
I need to know how to eliminate the non intersecting elements and do a clash detection between only the elements that are involved in clash physically. My Set A elements and Set B elements will be same (eg. Ducts, Pipes and Cable Trays)

You need to clarify what you mean. From what I understand you have a list of ducts: duct A and duct B, and you input this list into both inputs of the Element.IntersectsElement node. Now, assuming these ducts clash, you will get the following results:
A vs A = bypassed
A vs B = {B} (output)
B vs A = {A} (output)
B vs B = bypassed

What you are saying is you are seeing this (a picture would work wonders btw):
A vs A = {A}
A vs B = {B}
B vs A = {A}
B vs B = {B}

If that is the case (which shouldn’t be possible as the node doesn’t allow it), then upload a simple version of your model which reproduces the behaviour so it can be debugged.

Hi Thomas,

Please refer to the sample Revit File which has only ducts
It has some 25 ducts. My Set A and Set B elements are these same Ducts.
There are 4 visible clashes
Thus I should get 4 clash points rather than 8
I hope you understand.!

Hi @irfanmon21107 where are your files?

Hi Thomas,

Couldn’t upload the Revit file. Its not allowing me to upload more than 3mb.
Please chk the snip of the script.(Attached above)

Duct_vs_Duct_Revit_screen

Please help guys…!!!

@irfanmon21107 I took a look at this again and I think what you are trying to say is this:

Duct A vs Duct B results in:
AB
BA

As A is already known to clash B (AB), clash BA is therefore redundant; it’s a duplicate clash result, NOT a self-intersection clash result. Thanks for highlighting this in any case.

Firstly, the node is designed to function this way and adapting the behavior is problematic as:

  • Any change would interfere with clash tests involving two unique sets of elements where this problem obviously doesn’t arise
  • Checking if the same element sets have been input isn’t a simple as it sounds; if element set A and B contain ducts then, say, walls are added to element set A, a combination of different list management techniques need to be employed to ensure only unique clashes are output
  • Performing exhaustive checks on all elements to establish if elementSetA and elementSetB contain identical elements will impact negatively on performance, not to mention being unnecessary in situations where the two element sets are unique - careful consideration therefore needs to be made before any change is implemented

In the meantime, you can use this Python script to consolidate the clash results and only return the unique clashes. It will also handle the problem described above, where a combination of unique elements and identical elements are input. The graph below shows how to implement the script; please take careful note of the lacing used with the List.IsEmpty node - you need to clean the clash results of empty lists first, then process using the script. More details for removing empty lists is documented under the ‘Mitigating Dereferencing a Non-pointer Exceptions’ section in the article here:

#Copyright 2017. All rights reserved. Bimorph Consultancy LTD, 5 St Johns Lane, London EC1M 4BH www.bimorph.com
#Written by Thomas Mahon @Thomas__Mahon info@bimorph.com Package: BimorphNodes
#GitHub: https://github.com/ThomasMahon/bimorphNodes/
#Follow: facebook.com/bimorphBIM | linkedin.com/company/bimorph-bim | @bimorphBIM

import clr

clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

def ClashAvsClashBInDictionary(uniqueClashDict, key, results):
	elementCount = len(results) #Count the nunmber of elements in the results list (these are from elementSetB)
	while elementCount > 0:
		eB = results.pop(0) #Get the first item from the results list and remove it
		if key not in uniqueClashDict.Keys:
			if eB not in uniqueClashDict.Keys: #If the key is NOT in the dictionary then check if any of its result elements (from elementSetB) are also NOT present as a keys in the dictionary. If this statement is true, add eB back to the results list as its a unique clash which needs to be added to the uniqueClashDict. If this statement is false then popping the list removes the element and ensures only unique elements are returned
				results.append(eB)
		else:
			if eB not in uniqueClashDict[key]: #If the key is in the dictionary, get the key values and check if the eB element is NOT present. If true, append it to the key value (i.e. the results list in the uniqueClashDict). Popping the element has the effect of removing it from the results list so only the unique clashes associated with the key are stored
				uniqueClashDict[key].append(eB)
				
		elementCount -= 1 #Count down with each while loop to gurantee all elements in the results list are processed and the statement terminates successfully
	
	#If there are any elements left in the results list then the clash is unique and needs to be added to the uniqueClashDict
	if len(results) > 0:
		uniqueClashDict[key] = results

elementSetA = UnwrapElement(IN[0])
elementResults = UnwrapElement(IN[1])

uniqueClashDict = {}
for e, results in zip(elementSetA, elementResults):
	ClashAvsClashBInDictionary(uniqueClashDict, e, list(results))

OUT = uniqueClashDict.Keys, uniqueClashDict.Values
2 Likes

For some reason this python code is coming up with this error:
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 22, in
TypeError: NoneType is not iterable

Line22 is:for e, results in zip(elementSetA, elementResults):
ClashAvsClashBInDictionary(uniqueClashDict, e, list(results))