Filter element by length type parameter

I have a door containing Length type instance Parameter which has a numeric value. (See picture)

I want to filter element by this parameter value and trying node ElementFilter.ByParameterNumericValue but its throwing error : “Input string was not in correct format” i tried almost every possibility but still no result.
what am i missing here?

Just at first glance, your string input has a “.” separator and it looks like your Revit parameter has a “,”. Have you tried entering 0,020 into the Value input?

Yes, have tried with both
even with whole number

I was getting the same error message when I tried recreating what you were doing. It’s more nodes, but this gets you where you’re trying to go. I’ll keep looking into this when I have a bit more time, but I’m assuming it has to do with the String input for the Filter Method.

1 Like

@r.chowdhary

There is a node in archi-lab.net that would allow you to perform this operation:

Couple of things about this node and how it works so that we are on the same page:

  • ElementType input is set to FamilyInstance. There is no Type called Doors or similar. All Doors are actually FamilyInstance under the hood. A lot of other elements in the model, are also Family Instances so this filter might be a little slower than other methods. Just so you know.
  • ParameterName is actually the name of the BuiltInParameter that in the UI is called Head Height:

image

Why did I use the BuiltInParameter? That’s because this method grabs the first element it finds that matches FamilyInstance Type and then attempts to get the requested parameter from it. Since the FamilyInstance type contains other elements, not just Doors, its possible that it returns a piece of Furniture for example, and it won’t have that parameter, and it will fail. BuiltInParameter is obtained a little differently, and should be a much more reliable method. I realize that this is not the best way, and I will make a note to improve that node in the future. This is how it works now.

  • Value is being converted to internal units. That’s because all parameter values are actually stored in Decimal Feet under the hood (length is). That means that on the screen we see 2100mm but under the hood Revit stores 6.88976377952756 ft. That’s normal. That’s how Revit works. Just make sure that if your display units are different than ft. to always convert to ft.

Hope this helps.

All nodes used for this example can be found in archi-lab.net package.

Cheers!

3 Likes