I try take make a script that remove the Duplicate Items at the same position.
The script is almost ready but I have a little issue:
The node “all elements of category” takes all the familys include the nested family.
Is there a way to take only “primair family” without the nested family below?
It will return null, if the element is a parent family. So run it through this, and use the output to isolate your parent families from your original list
import clr
#Import the Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
#---###Start scripting here:###---#
elems = UnwrapElement(IN[0])
OUT = []
for i in elems:
super = i.SuperComponent
if super == None:
OUT.append(i)
else:
OUT.append('This is a SubComponent')
import clr
#Import the Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
#---###Start scripting here:###---#
elems = UnwrapElement(IN[0])
OUT = []
for i in elems:
super = i.SuperComponent
if super == None:
OUT.append(i)
else:
pass