I’m having issues with the below collector as it doesn’t select the ducts with 1400 lengths (yes they are in the model). Any advice is appreciated just starting out on python. Aim is to collect ducts with 1400 lengths.
from Autodesk.Revit.DB import *
doc = __revit__.ActiveUIDocument.Document
uidoc = __revit__.ActiveUIDocument
#Provider
pvp = ParameterValueProvider(ElementId(BuiltInParameter.CURVE_ELEM_LENGTH))
#Evaluator
fnrv = FilterNumericEquals()
#Filter ducts that are 1400 in length
ruleValue = 1400
#Rule
fRule = FilterDoubleRule(pvp, fnrv, ruleValue, 1E-6)
#Parameter filter to pass into WherePasses Collctor
ParamFilter = ElementParameterFilter(fRule)
duct = FilteredElementCollector(doc) \
.WherePasses(ParamFilter) \
.ToElementIds()
uidoc.Selection.SetElementIds(duct)
Sorry I should have specified, this is being done through a Python shell in revit not Dynamo, so no need for IN[0] lists. The collector should collect all built in parameters of CURVE_ELEM_LENGTH then filter the ones with 1400 value.
There are no errors when I run the code but it doesn’t collect any elements so just seeing if anyone can see where I have gone wrong or missed something.
Reading the document and came across the Units sections where the Length is actually shown in feet within Revit. Once I converted the 1400mm to feet this worked fine