I want to get each element that does not yet have "theValue" for a specific parameter. In the following code example i filter for elements that DO have the value, how do i reverse/invert this to get what i need?
FilteredElementCollector fec = new FilteredElementCollector(doc);
var elements = fec.ToElements();
var id = elements[0].LookupParameter("IfcName").Id;
ParameterValueProvider pvp = new ParameterValueProvider(id);
var fsc = new FilterStringEquals();
var ruleValue = "theValue";
var frule = new FilterStringRule(pvp, fsc, ruleValue, false);
var filter = new ElementParameterFilter(frule);
fec = fec.WherePasses(filter);
Solved! Go to Solution.
Link copied