I'm trying to use a FilteredElementCollector inside my pyRevit script to collect all views (sections, elevations, plan callouts etc.) in the active view.
from pyrevit.framework import clr
from pyrevit import revit, DB
clr.AddReference('RevitAPI')
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.DB import *
from pyrevit import forms
doc = __revit__.ActiveUIDocument.Document
view = doc.ActiveView
AllStuff = FilteredElementCollector(doc,doc.ActiveView.Id).WhereElementIsNotElementType().ToElements()
AllViews = []
try:
for x in AllStuff:
if "View" in x.Category.Name:
AllViews.append(x)
This will return some, but not all of the views. For example, some sections are included but others are not and I can't tell why.
If I add ".OfCategory(BuiltInCategory.OST_Views)" I get nothing at all. Do I need to break it down into several more specific categories? Thanks for any help.