I totally understand you and that was definitely not what I intended. Sorry!
I tried to take the idea from the link and put it in a python script. Sorry, I’m at the very beginning with this. Maybe I should have started with something easier…
But here is what I have so far. It seems to work until the filter. (If I delete the row #35 and say “OUT = rules” I get an output…)
So, I would be very thankful if you could help me with this: filter = ParameterFilterElement.Create(doc, ‘Test’, categories, rules)
I don’t see what is missing, or is it a wrong code?
import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
from System.Collections.Generic import *
clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
view = doc.ActiveView
#name = IN[0]
#category = IN[1]
#parametername = IN[2]
#parameterrule = IN[3]
#parametervalue = IN[4]
categories =
categories.Add(ElementId(BuiltInCategory.OST_Walls))
collector = FilteredElementCollector(doc)
wallWidth = collector.OfClass(WallType).FirstElement().get_Parameter(BuiltInParameter.WALL_ATTR_WIDTH_PARAM)
rules =
rules.Add(ParameterFilterRuleFactory.CreateLessRule(wallWidth.Id, 0.5, 0.001))
#TransactionManager.Instance.EnsureInTransaction(doc)
#filter = ParameterFilterElement.Create(doc, ‘Test’, categories, rules);
#view.AddFilter(filter.Id)
#TransactionManager.Instance.TransactionTaskDone()
OUT = rules

Thanks,Dennis