Hi, is it possible to get all the family instance of a category in a list ?
I would like to place all of them in one point
Somthing like this will let you collect all family types
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
# fams = FilteredElementCollector(doc).OfClass(Family).ToElements()
famTypes = FilteredElementCollector(doc).OfClass(FamilySymbol).ToElements()
OUT = famTypes #, fams
1 Like
Thanks you both are woking !!
@Jean-Marc j’ai essayé le code Python en souhaitant collecter uniquement une catégorie donné (en INPU)
J’ai changé la ligne :
famTypes = FilteredElementCollector(doc).OfClass(FamilySymbol).ToElements()
en
famTypes = FilteredElementCollector(doc).OfClass(OST_PipeAccessory).ToElements()
Mais n’arrive pas à obtenir toutes les familles et type de la catégorie PipeAccessory…
Sais-tu comment faire ?
Merci d’avance
not tested but something like
filter = ElementCategoryFilter(OST_PipeAccessory)
collector = FilteredElementCollector(doc).OfClass(FamilySymbol).WherePasses(filter).ToElements()
1 Like
or rather
.OfClass( FamilySymbol ).OfCategory( BuiltInCategory.OST_PipeAccessory ).ToElements()
1 Like