Is there any way to filter all the elements of subcategory. My intention is to count the subcategory elements inside a family. i created a simple curtain wall with only two mullions and its subcategory name is jamb. can i collect the details of those two mullions?
import clr
import sys
sys.path.append('C:\Program Files (x86)\IronPython 2.7\Lib')
import System
from System import Array
from System.Collections.Generic import *
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference("RevitAPI")
clr.AddReference("RevitAPIUI")
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = uiapp.ActiveUIDocument
#######OK NOW YOU CAN CODE########
# The inputs to this node will be stored as a list in the IN variables.
elem = UnwrapElement(IN[0])
pa = elem.Parameters
gde = elem.GetDependentElements(None)
dep_elmts = []
dep_names = []
jamb_length = []
sub_catList = []
for i in gde:
el = doc.GetElement(i)
dep_elmts.append(el)
dep_names.append(el.Category.Name)
if el.Category.Name == "Curtain Panels":
p = el.LookupParameter("Jamb").AsValueString()
sub_catList.append(el)
jamb_length.append(p)
all_jamb = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Cornices).ToElements()
#p = dep_elmts[1].LookupParameter("Jamb")
#pa = elem.LookupParameter("Jamb")
# Place your code below this line
OUT = all_jamb