Change Pipe System Size from Name

Hello all,

I’ve searched for a solution for this for a little while now so I thought I’d go ahead and make a post.
Attached is a screenshot of a working script I’ve made (with my limited understanding of Dynamo, I’m very new to this) that will change the size of a given pipe system based off of the “System Name” parameter. However, I would like to instead change the pipe size based off of the “System Type” parameter. The only trouble is it doesn’t seem to be as simple as changing the code block containing “System Name” to “System Type” and then defining the System Type within the code block I have labeled as “System Name”.

The Code Blocks called “System Name” and “Pipe Diameter” are intended to be user inputs so that I can easily run this script through the Dynamo Player.

I am open to any and all constructive criticisms of my diagram! Here’s to hoping what I want to achieve is actually possible, as I seem to keep running into limitations of Revit with other Dynamo projects I’ve attempted.

Thank you!

One of the most powerful things that visual coding gives us, is the ability to see our data at every step of the way. It’s hard for us to help you if we can see your data moving through your graph. If you look at your node previews you’ll probably be able to figure out why it’s failing. The System Type parameter returns an element, which is why you can’t compare it to a string. You need to get the name from the System Type before you make the comparison.

1 Like

Thank you for your response, I appreciate it!

If I understand what you’re saying I need to use the “Element.GetParameterValueByName” node similarly to how I am retrieving the System Name from the pipe elements themselves? When I do this, I end up with the element ID’s but no names to reference as strings.

EDIT: Okay I was able to pull the names as strings with “Element.Name”, but to my dismay I end up with the “System Name” parameter again instead of the “System Type” parameter. And that doesn’t seem to be something I can call up with the “Categories” node.

Nick, thank you for giving me a “spring board”, I figured it out!

This node graph is working how I intended it to, successfully changing the pipe size of a system based on that system’s name.