BuildingCoder.YbUtil.FindAllViewsThatCanDisplayElements C# (CSharp) Method

FindAllViewsThatCanDisplayElements() public static method

public static FindAllViewsThatCanDisplayElements ( Document doc ) : IEnumerable
doc Document
return IEnumerable
        public static IEnumerable<View> FindAllViewsThatCanDisplayElements(
            Document doc)
        {
            ElementMulticlassFilter filter
            = new ElementMulticlassFilter( new List<Type> { typeof( ViewPlan ) } );

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