Hanger Rod Adjustment By Hanger Size Filter

I am attempting to filter the “Hanger Size” parameter value out of a family and in order to adjust the “Rod Extn Below” parameter value so that the hanger rods can be fabricated to the right length. In the example I am posting I aiming to take the 4" “Hanger Size” and set the “Rod Extn Below” at 1.5". Once I have a script that works I am planning to do the same for each size of hanger at various lengths.

image

List.Filter isn’t the best approach here. You’re not giving it a condition and you don’t want to filter the values, you want to filter the elements.

Really the best approach would probably be to use a dictionary. This would allow you to set the lengths based on size for all sizes at once. Springs has a node that’s great for this. Set up your dictionary to return the extension length based on the size then just apply the new values to all elements at once.

I am still not doing it correctly. This is my first in depth graph and I still have a lot to learn about writing scripts. Here is a snapshot of what is going on now. I wrote one this morning that extended the rods to a set depth on the top side. That script was pretty simple and worked great. This one is a bit more complex than the one from earlier.

mv

What’s the parameter type in Revit? Your graph suggests it’s an Integer/Number. If the parameter is a Length (you said 4") you’ll need to get the graph to match (or convert from Length to Number in Dynamo)

You’re trying to set the parameter of the family type. If this is an instance parameter you need to set the value for the element instance. Run the All Elements of Family Type output into the elements input for SetParameterByName.