Browse through element parameters efficiently

Hello all,

I’m currently working on a Revit file that hosts around 500 clashes defined as instances of several families by a general contractor that I have to get geometry info from to send to Tekla.

I then proceeded to do a small file that contains several routines . That file has to be reusable on other files sent by the same contractor so it has to work regardless of the name of the families/types/parameters. I also have to do a user-friendly interface because I won’t be the final user of the script.

Getting the families and types is okay because I can filter them by name and category using the query types component and a name pattern in the “Family Name”/"Name input parameter as shown:

So extracting all the types works great and I then can get the ones I’m interested in using a value set picker and feeding them to a Type Instances component.

But if i then want to extract a specific parameter from the said elements, it gets more cumbersome. Sadly the Query Element Parameters doesn’t seem to support name patterns so I have to get more parameters than I need to, send these to a ParameterKey Identity component, through a Value set picker and in a Query Parameters component again as shown.

Not easy on the eyes. The last query component also a lot of time to compute, around 20 seconds, per parameter, so even though I know I can internalise, it’s tough even with 6 parameters to fetch.

Is there a better way to do what I intend to do ? Thanks

Hi @aduffau,

I added pattern matching to the ‘Query Element Parameters’ component to the next release. It’s available on the Daily channel (v0.6).

About the second ‘Query Element Parameters’ you can just avoid it and connect the name to the ‘ParameterKey’ input on the last ‘Get Element Parameter’.


Thank you so much for your answer. About the pattern matching, this is great to know. I didn’t know you could feed parameter names to parameter key inputs. This takes much less computing time so this is great.
One minor question though. Is there a particular interest in using parameter keys to refer to parameters if we don’t internalise the given parameter name as text and keep it live in case the name changes.

Best regards,

Not in your case that you want to reuse same Grasshopper document on several Revit models.

A parameter key referes to a specific parameter in a specific document, same aplies for categories, types and other elements. In other words two parameter with the same name in two different documents are different ‘ParameterKeys’.

1 Like