from Autodesk.Revit.DB import *
import clr
clr.AddReference("System")
from System.Collections.Generic import List
doc = __revit__.ActiveUIDocument.Document
uidoc = __revit__.ActiveUIDocument
app = __revit__.Application
p_fam_id = ElementId(BuiltInParameter.SYMBOL_FAMILY_NAME_PARAM)
f_param = ParameterValueProvider(p_fam_id)
evaluator = FilterStringContains()
value = 'FE TÜR'
rvt_year = int(app.VersionNumber)
if rvt_year >= 2023:
f_rule = FilterStringRule(f_param, evaluator, value)
else:
f_rule = FilterStringRule(f_param, evaluator, value, False)
filter_fam_name = ElementParameterFilter(f_rule)
element_ids = FilteredElementCollector(doc)\
.OfCategory(BuiltInCategory.OST_Windows)\
.WherePasses(filter_fam_name)\
.WhereElementIsNotElementType()\
.ToElementIds()
uidoc.Selection.SetElementIds(element_ids)