RVTDocs.com
Namespace: Autodesk.Revit.DB

CurveElementFilter

Class
Description:
A filter used to pass curve elements which are of a specific type.
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.ElementFilter
    Autodesk.Revit.DB.ElementSlowFilter
      Autodesk.Revit.DB.CurveElementFilter
Syntax
public class CurveElementFilter : ElementSlowFilter
Examples
// Create a CurveElement filter to find CurveByPoints elements.
// It is necessary to use the CurveElementFilter, and not an ElementClassFilter or  the shortcut 
// method OfClass() because subclasses of CurveElement are not supported by those methods.
CurveElementFilter filter = new CurveElementFilter(CurveElementType.CurveByPoints);

// Apply the filter to the elements in the active document
FilteredElementCollector collector = new FilteredElementCollector(document);
ICollection<Element> founds = collector.WherePasses(filter).ToElements();


// Find all curve elements: use inverted filter with invalid CurveElementType to match elements
CurveElementFilter notCurveByPntFilter = new CurveElementFilter(CurveElementType.Invalid, true); // inverted filter
collector = new FilteredElementCollector(document);
ICollection<Element> notCurveByPntFounds = collector.WherePasses(notCurveByPntFilter).ToElements();