Learn how to filter elements in Revit API
Detailed content about filtering...
FilteredElementCollector collector = new FilteredElementCollector(doc);