Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm implementing a filter feature where I want to be able to filter the parameter values of family instances.
I'm using an ElementParameterFilter like so:
var parameterProvider = new ParameterValueProvider(parameterId);
var rule = new FilterDoubleRule(parameterProvider, new FilterNumericGreater(), doubleValue, double.Epsilon);
var collector = new FilteredElementCollector(doc).WherePasses(new ElementParameterFilter(rule)).Cast<FamilyInstance>();
Which works... but not on the values visible in Revit instance properties list, which in this case should be the "Flow" parameter with value "76".
When I write the parameter value and valueString:
var result = $"id: {element.Id.IntegerValue}, valueString: {parameter.AsValueString()}, value: {parameter.AsDouble().ToString()}"
it gives: "id: 4865584, valueString: 76, value: 2,68391467083313"
When I use the filter it will be applied on the value (2,68391467083313), not the valueString (76)!
But the user will most likely expect to be able to filter on 76, not 2,68391467083313.
How can I filter on the valueString as well?
Thanks!
Solved! Go to Solution.