I’ve read through a few posts on here and i’ve tried a few things but cant quite get it working.
im trying to:-
get all elements of a category in the active view.
get family name of elements
filter out the elements based on the family name containing “???”.
import clr #Import Revit Nodes clr.AddReference("RevitNodes") import Revit clr.ImportExtensions(Revit.Elements) # Import RevitAPI clr.AddReference("RevitAPI") import Autodesk from Autodesk.Revit.DB import * # Import DocumentManager and TransactionManager clr.AddReference("RevitServices") from RevitServices.Persistence import DocumentManager from RevitServices.Transactions import TransactionManager dataEnteringNode = IN #The inputs to this node will be stored as a list in the IN variables. #Get the project document. doc = DocumentManager.Instance.CurrentDBDocument #Filter for category. collector = FilteredElementCollector(doc, doc.ActiveView.Id) filter = ElementCategoryFilter(BuiltInCategory.OST_DuctFitting) category = collector.WherePasses(filter).ToElements() familyname = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_DuctFitting).WhereElementIsElementType() #Assign your output to the OUT variable. OUT = category, familyname
im getting all the elements in the category from the active view which is great.
but I cant get the ‘familyname’ to output the actual family name.
from there Id like to filter the elements by the family name so if it contains ‘Bend’ or ‘shoe’ etc
I’ve tried a few things with FamilySymbol, .FamilyName and AsString, based on other threads in on here, but always seem to end up with empty list or errors.
or is there a better way of going about it? finding all instances of a family type and just list out the ones i want to collect?
any advice would be great!