Collect Elements from File

Collect specific type of Revit element
Collect specific type of Revit element

How to get specific type of element from document ?

Do you know the steps to select pipe elements in a Revit file? Specifically, if you want to collect all the pipe elements in the active Revit view.

Look at the code snippet above, this code describes that how to collect all the pipe elements present in the document (project file).

The class FilteredElementCollector class in the Revit API is a powerful tool for retrieving elements from a Revit document based on specific criteria or filters. Here the criteria that is used is Pipe class, by which the FilteredElementCollector will only collect elements which are pipe.

Element collection based on active view
Element collection based on active view

Look at the code snippet above, this code describes that how to collect all the pipe elements present in the active view of the project file.

Here in this code we have used two parameters --> document, document.ActiveView.id. the second parameter defines that the collection will be based for the elements present in that view.