Category of ViewFilter

Hello Everyone,

I have a view filter parameter and I want to get the Categories, Rules of one. Is it possible to get it by Dynamo node or Python and how to.

Many thanks,

You can with python, but you’ll need to be comfortable with the Revit API. Here’s some code for getting the Categories.
Getting the rules is a lot harder and not that easy to code if you don’t know what you’re looking for.

import clr

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument

clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

filters = UnwrapElement(IN[0])
categories = []
for filter in filters:
	cat = filter.GetCategories()
	sublist = []
	for c in cat:
		sublist.append(Category.GetCategory(doc,c))
	categories.append(sublist)
#Assign your output to the OUT variable.
OUT = categories
1 Like