Get all elements of family type loaded in project, but not placed

Thanks @Marcel_Rijsmus and @jacob.small

That put me on the right track… I used a slightly different workflow after getting the element by sorting by searching for matching strings. Could not get the OOTB string contains etc or the == nodes to work as required so resorted to a python node script from here:

Here’s the code used also

strList = IN[0]
elementNames = IN[1] # Getting the names in Dynamo before Python saves unwrapping
elementList = IN[2]

searchList = []
restList = []

for n, e in zip(elementNames,elementList): # zip together names and elements
	found = False # assume search strings can't be found
	for s in strList: # Loop through the search strings
		if s in n: # test whether the string can be found in the name
			searchList.append(e) # if true, add to searchList
			found = True # set found to be true
			break # skip remaining tests as string has been found
	if not found: # if found is false after testing all strings
		restList.append(e) # append to restList

# Assign your output to the OUT variable.
OUT = searchList, restList

1 Like