BuildingCoder.ExtensionMethods.FindAllViewsThatCanDisplayElements C# (CSharp) Method

FindAllViewsThatCanDisplayElements() static private method

Return an enumeration of all views in this document that can display elements at all.
static private FindAllViewsThatCanDisplayElements ( this doc ) : IEnumerable
doc this
return IEnumerable
        static IEnumerable<View> FindAllViewsThatCanDisplayElements(
            this Document doc)
        {
            ElementMulticlassFilter filter
            = new ElementMulticlassFilter(
              new List<Type> {
            typeof( View3D ),
            typeof( ViewPlan ),
            typeof( ViewSection ) } );

              return new FilteredElementCollector( doc )
            .WherePasses( filter )
            .Cast<View>()
            .Where( v => !v.IsTemplate );
        }