Get a list of all elements in model that are part of any family (can be a specific category) with <string> in family and/or type name

Is it possible?

@peter1343 ,

check out this topic

KR
Andreas


this should do it gets all families loaded into the project of every category. (should take nested families as well but i have not tested it).

not completely sure i understand what you are after but this should get you started

Yes I have the elements. I want to write a Python script to filter elements based on their family and/or type name.

What is the API call in Python to get this info from an element

@peter1343 ,

try this :

import clr
import sys 

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#collector
collector = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls)
all_elements = collector.WhereElementIsNotElementType().ToElements()

#filter 
Psets = [i for i in all_elements if i.Name.Contains("STB")]


OUT = Psets