I've just started workin with Revit API and I have one question. I've been looking for a way now to filter Revit elements by Family. Here's my procedure: First I do a filtered element Collector to obtain all family symbos Ids.
Families = FilteredElementCollector(doc).OfClass(Family).ToElements()
for fam in Families:
if fam.Name == 'Family Name':
FamSymb = fam.ID
This should get me the family symbol Id. Then, I try to create the filtered element collector with this Id.
ElementFilter = FamilySymbolFilter(ElementId(FamSymb))
New_Collector = FilteredElementCollector(doc).WherePasses(ElementFilter).ToElementIds()
This gives me the following error: Microsoft.Scripting.ArgumentTypeException: expected BuiltInParameter, got ElementId
.
I don't know why it is expecting a BuiltInParameter
, if the FamilySymbolFilters
ask for an element Id.
Anyway, Any help will be highly appreciated.
Thanks!