Is there a way to get all the subcategories of a specific family from the project file? I used this code, inputing the category of the family and the family document of that specific family, but it returns all the subcategories of that category in the project and I want just the subcategories that are present in that specific family (so all the subcategories “coming” from that family)
import clr
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
cat = UnwrapElement(IN[0])
fam_doc = UnwrapElement(IN[1])
subcat = cat.SubCategories
OUT = [Revit.Elements.Category.ById(x.Id.IntegerValue) for x in cat.SubCategories]