Find all elements

Is it possible to retrieve all elements from file, and not be depending on type or category? I am looking for Document.AllElements from Archi-Lab, but can find the node

1 Like

@331173

you can do the job via python

import clr
clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager

clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import FilteredElementCollector

# 0ļøāƒ£ Get the active document
doc = DocumentManager.Instance.CurrentDBDocument

# 2ļøāƒ£ Collect all elements in the document
all_elements = FilteredElementCollector(doc).WhereElementIsNotElementType().ToElements()

# 3ļøāƒ£ Output the result
OUT = all_elements
1 Like

First, you need to understand what an ā€œelementā€ is in Revit terms and if thatā€™s really what you want. In Revit, ā€œelementā€ just refers to anything using the Element base class - which is most objects you can interact with. This isnā€™t just walls, floors, and pieces of equipment. Elements includes things like rooms, views, links, parameters, worksets, and tons of other various object types.

I assume that you, like most people, are after the model elements specifically - the physical elements that make up the 3D model. Thereā€™s no single method for getting all those objects, but a FilteredElementCollector is usually the way to go. You could use a collector to get all the FamilyInstances of loadable families and then youā€™d need separate collectors for the instances of the system families.

2 Likes