Get the connector of the next pipe fitting while it doesn't find the pipe

The script I am working on essentially intends to take the information from the pipe connected to the accessory pipe and use it. I based my code on MEPover’s code to get the elements connected to each pipe accessory and if that element was a pipe fitting that it would try to find the pipe again.

The problem is that since I didn’t do it with something like a “while” or a “map” it only tries once, and when there are 2 or more pipe fittings before fiding the pipe it no longer finds the “indirectly” connected pipe …
I tried to use def, but I can’t get the syntax to work (I am kind of new in python)
Test_ Pipe Ace.dyn (22.8 KB)

Could someone help me?

Test_ Pipe Ace.dyn (22.8 KB)
Test _ Pipe Ace.rvt (2.7 MB)

Hello @lcp9RMNF
your pipe fitting has a connector not connected (physically) to your Pipe accessory

*Note *
Remember to indicate the version of the Revit file

hello @c.poupin
thanks for the answer
yes, sorry. I sent it disconnected, but this situation connected happen in the project many times, and with the code as It is at the moment it just grab the first fitting :confused:

Revit 2020.2
Dynamo 2.0.3

If you use the Connector as input to the ‘Elements in Connected Network’ node and set the ‘IncludeInputElement’ input to false then it will return everything that is connected to that connector.


After that you’d need to filter the results a bit further (by category for instance) to only return the pipe.

1 Like

Thank you @T_Pover! I’m trying and it works :slight_smile:

1 Like