Intersection points (between linked and project elements)

hi everyone,
When The pipe diameters are below 75mm, code is not showing clash points. it gives (x=0, y=0, z=0)
works well when diameter is above 75mm.

clash points.dyn (30.4 KB)
Project2022.rvt (5.3 MB)
LINK FLOOR.rvt (1.4 MB)


import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#The inputs to this node will be stored as a list in the IN variable.
#dataEnteringNode = IN

clashElementsAdirty=IN[0]
clashElementsBdirty=IN[1]

# Start Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
clashElementsA = []
clashElementsB = []
clashGeomA = []
FailuresA = []
clashGeomB = []
FailuresB = []
clashFoundA = []
clashFoundB = []
clashSolids = []
clashPoints = []
for a in clashElementsAdirty:
	try:
		clashGeomA.append(a.Geometry()[0])
		clashElementsA.append(a)
	except:
		FailuresA.append(a)
for b in clashElementsBdirty:
	try:
		clashGeomB.append(b.Geometry()[0])
		clashElementsB.append(b)
	except:
		FailuresB.append(b)

counterA = range(len(clashElementsA))
counterB = range(len(clashElementsB))

for i in counterA:
	tempGeomA = clashGeomA[i]
	for j in counterB:
#		tempGeomB = clashGeomB[j]
#		clashIntersectResults.append(tempGeomB.DoesIntersect(tempGeomA))
#		if tempGeomA.DoesIntersect(tempGeomB):
		if clashGeomA[i].DoesIntersect(clashGeomB[j]) == True:
#		clashIntersectResults.append(clashGeomA[i].DoesIntersect(clashGeomB[j]))
			clashFoundA.append(clashElementsA[i])
			clashFoundB.append(clashElementsB[j])
			tempSolid = clashGeomA[i].Intersect(clashGeomB[j])
			clashSolids.append(tempSolid[0])
			clashPoints.append(tempSolid[0].Centroid())

# End Transaction
TransactionManager.Instance.TransactionTaskDone()

#if fileversion == "":
#	OUT="Default settings used"
#else:
#	OUT=total_export
OUT = clashFoundA, clashFoundB, clashSolids, clashPoints, FailuresA, FailuresB

Hi,

Not sure if you need to do it in a python script.
There seems to be some issue when intersecting geometry of pipe smaller than 75.
I got faster run times with the use of pipe center lines rather then the whole geometry.
It could be done something like this.

The second part of the graph is just if you want to get the center point of the intersection.


I would just replace the vector.z with curve.length so if the pipe is not perfectly straight it will still get the center.

Hope this helps.

@Josip.Komadina
This one is also an option but Im looking for above code