So this has got me perplexed…
I collected all the Wall Instances in a list and than I got their respective Wall Types. Then I wanted to sort this list in the same Python Node to get a list of uniqe values of Wall Types that are present in the model but it didnt work. I tried the “if not in” method and the sort() function but neither seems to work.
If I use the “unique values” Dynamo Node OR perform the sorting in another python node than it works. Can anyone explain??
“GET WALL TYPES NODE”
Category = ListBuiltInCategory
category.Add(BuiltInCategory.OST_Walls)
filter = ElementMulticategoryFilter(category)
collector = FilteredElementCollector(doc).WherePasses(filter).WhereElementIsNotElementType().ToElements()
types = []
data = []
for item in collector:
types.append(item.WallType)
# Code unterhalb dieser Linie platzieren
for i in types:
if i not in data:
data.append(i)
OUT = data
“IF NOT IN” NODE
data = []
# Code unterhalb dieser Linie platzieren
for i in IN[0]:
if i not in data:
data.append(i)
# Weisen Sie Ihre Ausgabe der OUT-Variablen zu.
OUT = data
“SET METHOD” Node
OUT = set(IN[0])