Im starting to dive into Dynamo. To start off, I’m looking for a way to rename the pipes in my drawing. I currently have a network with structures which I manually named as CB 1, MH 1, CB 2, etc. I want to rename the pipes in between the structures to say the start structure to the end structure (for example, CB 1 TO MH 1).
Is there a way to return a pipe network by name instead of the order it appears in the list? For example, if I currently just have one pipe network (storm) in this drawing and set it to x[0], dynamo will work fine. But if I later add another network, say sanitary, then storm will be pushed down in the list and I’ll have to renumber it to say x[1].
Sure. You can use the “PipeNetwork.GetPipeNetworkByName” node in the camber package and pass it the name of your pipe network as a string (use either a string node or text in a code block node in quotes).
But I imagine it will be easiest for your needs to simply click on a pipe to select the network to update. If that is the case you can do something like this:
Thanks, I think clicking the pipe to select the network would be the best option since I wouldn’t have to modify anything in the code and then can be used for any drawing.
The one caveat with that approach is that the script will break if anything other than a pipe is selected. But if you’re the only one using it, then it might not be a concern!
I used the script that was provided by WrightEngineering and it worked great last year. Today I tried using it again but I’m getting an error message, anyone know what went wrong or how to fix?