How to find intersect solid and delete duplicate

Hi all, i would like to made a script to filter duplicate element and sort only one in a connection point.
with attached dyn file and screenshot. Thank you


Hi, @jcchan1112.
You can also try with Geometry.PruneDuplicates from Data-Shapes package.

Thanks your reply, i have tired but not i want the goal. I want every connection point also have one family in there.

Well, share rvt and dyn files, we’ll try to help you.

Sorry, the revit file size is larger than 8mbs so cannot upload here, i attached the capture picture what i want the goal, and i upload the dynamo script.


Delete duplicate.dyn (27.9 KB)

hi maybe try this:
the python script will collect all duplicated items, then you can use unique list and get the one of the items.

import clr
from System.Collections.Generic import *
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitNodes")
clr.AddReference("RevitAPI")
import Autodesk 
from Autodesk.Revit.DB import *

ids = IN[0]
bbox = IN[1]

duplist = []
for i in range(len(ids)):
	temp = []
	for j in range(len(ids)):
		if i != j:
			boo = Geometry.DoesIntersect(bbox[i], bbox[j])
			if boo == True:
				temp.append(ids[i])
				temp.append(ids[j])
				temp.sort()
				break
	duplist.append(temp)

OUT = duplist
1 Like

Hi, this script is works, but i have a problem
When i use element.delete node, i need play many times and then able to delete duplicate elements, do you know why ?

Thanks

Use List.RestOfItem instead of first item, that way you keep the earliest one in each case and get rid of the rest. If you use firstitem it will keep going until there are no intersections so will need many runs for areas with 2+ connections.

2 Likes

try to use elements.delete from archilab instead?