FilteredElementCollector viewCollector = new FilteredElementCollector(doc); IEnumerableviews = viewCollector .OfClass(typeof(View)) .Where(x => !(x as View).Is3DView()); bool hasAnyView = views.Any();
FilteredElementCollector wallCollector = new FilteredElementCollector(doc); IEnumerableIn this example, we use the Any method to check if there are any walls that match the specified filter criteria. The package library used in this example is the Autodesk.Revit.DB package.walls = wallCollector .OfClass(typeof(Wall)) .Where(x => (x as Wall).Width > 10); bool hasAnyWall = walls.Any();