Select elements by parameter

Hi all,

I only started working with dynamo last week and I really tried finding the answer to this, because it seems infuriatingly simple, but i’ve seriously hit a rock.

How can I select a a set of elements that have a parameter value that contains or it si equal to something?
Ie, i want to select all the corridirs in my project.

Thank you for your time.

Hi @kveleva

There are many ways to do that . Here is one way that , I think, is pretty clean :

10 Likes

Try selecting all elements of category and then filtering by a value in the parameter.

11 Likes

thank you!

You got more than you asked for! :slight_smile: Good work @Mostafa_El_Ayoubi!

1 Like

I’m trying to achieve something similar. My goal is to override wall cut colors based on their base constraints. Here is what I have. Right now it changes every wall’s color regardless of their base constraint. My gut says I need to filter my list of walls somehow, but that’s the disconnect of my previous grasshopper knowledge and my relatively nonexistent dynamo knowledge… Any help or links to better discussions are appreciated.

1 Like

Look how @Mostafa_El_Ayoubi has a “list.first item” node you are missing.

Even with it I get the same result, the list is still all included in the first item. Can I add a branch to the tree somehow? Sorry for the inexperience/grasshopper lingo

My file so far

Wall Base Constraints Color Override.dyn (10.0 KB)

The output of GroupbyFunction should be two lists, but it looks like equality doesn’t work for levels.

Here are two options:

1 Like

@kveleva Were you able to get the original ones to work for your parameters?

I managed to get it by finding the indices of the desired walls in the list by their level parameter.

yep it worked fine :slight_smile:

Disclaimer - very new to Dynamo.
I am trying to Select Structural Framing members that are beam drags. I started with Timon’s first response. I am only getting false readings from my == node. So it is telling me there are no members that have “Beam Drag” as the field in the “Start Connection” Parameter. Which is not the case.

I put a watch node on the my get parameter value node and it is coming back with None or StructuralConnectionType?? there are some beams that have ‘None’ as the “Start Connection”, but none of them have StructuralConnectionType. Could someone help me with this one?

I can’t upload since I am a new user.

@Timon could you help me with this one?

Hi @dan_buys. This topic is not really adressing your issue. check out this one:

@dan_buys I agree with @Mostafa_El_Ayoubi. This is not exactly what this thread is talking about, so I’ll summarize for those who are new to the Dynamo environment and general Revit API. Some parameters are stored as Booleans (true/false), others as text, others as numbers, and other as elements or something completely different. In many cases if I am trying to filter by these you can either filter by the information as it is stored, (e.g. compare structural connections to structural connections, etc). or you can use the String from Object Node (then I can compare string to string). What @dan_buys and (trust me we have all done it) was trying to do was compared and element to a string (or text). Thus it will always tell you that an object with a name of “Moment Connection” will never equal the text “Moment Connection”. I hope this is helpful and only answer it in this context because I believe it will assist others who are learning about filtering by parameter. This is not only applicable to Structural Connections, but many other areas.