Select All Elements at Filter

Hi, I’m search for method to get “Select All Elements at Filter” in dynamo. While filter is already created in revit .
whatever filter based rule or selection set .

Maybe look here?

1 Like

The following graph gets all elements which pass a filter of a specific name:


collect based on filter alt.dyn (3.9 KB)

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import FilteredElementCollector, ParameterFilterElement
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument
name = IN[0]

# Get all ParameterFilterElements in doc
filter_elements = FilteredElementCollector(doc).OfClass(ParameterFilterElement)
filter_names = [f.Name for f in filter_elements]
filters = [f.GetElementFilter() for f in filter_elements]
filter_dict = dict(zip(filter_names, filters))

elements = []
if name in filter_dict:
	filter = filter_dict[name]
	elements = FilteredElementCollector(doc)\
		.WherePasses(filter)\
		.ToElements()

OUT = elements
3 Likes

Thanks for your time

1 Like