Request for new Component or workaround - Has Value Rule

In a script I’m working on I am looking to filter to all linked elements with a valid parameter value. In the Revit UI, the way I do this is by specifying two filters. Unfortunately one of them is not available as a node.

“Parameter has value” AND “Parameter value != “““ (empty string)

This will grab any elements with a string parameter value that’s been specified and avoid ones who had a parameter value that was later blanked out. In other syntaxes, we might say

ParameterString != null AND ParameterString.Length > 0.

The associated Revit API is here.

Hi @Alexander_Kaplan

Have you tried the following

@Muhammad_Saqlain_Awa what values are you placing in the “Value” input?

for Not Equals, I could use a blank panel. But for equals, I dont want to match against a specific text, I want to catch any and all values that are input. In my usecase, I am looking to gather all elements for which a parameter has been set to a value (any value)

You can also extract all the parameters and then remove or separate the parameters with empty values.

Following up so this thread has an answer. Yes, this is what I needed to do. I was hoping to avoid this since I had ~20k elements and only ~500 of them had values. Extracting the 19k blank values has a performance hit. I rebuilt the same code in Dynamo python and didn’t see much of a performance difference, so I’m not too bothered by this method. It would still be nice, but not necessary to expose the full ‘filter’ API.

1 Like

you also check the following example. here we also had empty values.