Reading direction property of connectors on ducts/pipes

I’ve found a Python script on this forum to help me read properties from connectors in pipes and ducts. In an attempt to use this, I’ve extracted all positions and directions, and let Dynamo place a dot on all connectors with direction In.

Sadly, this revealed that this direction property doesn’t appear to be set correctly. In half the cases it appears that the connector set to In is actually on the side where the medium is leaving the duct or pipe, which seems illogical to me.

Has anyone seen this behavior before, or does someone know a way to reliably get the flow direction in ducts and pipes using Python?

1 Like

Hi @Bram_Weinreder1

Yes its possible to do with python but to be sure please drop screenshots what exactly your looking for. Thanks :slight_smile:

1 Like

Seems to be working fine for me: in the picture below the open end of the labeled duct, shows ‘false’ in my script indicating it’s the open end on the duct and the corresponding index for the direction is set to ‘In’ which is also correct.

Maybe you could show some more of your work and show us where things are going wrong for you.


This is the Dynamo script I’ve made. Each of the Python nodes are very similar. The bottom one extracts the connector direction, the three above respectively the x, y and z co-ordinate for its position (and then converted from feet to millimeters).

The blue dots are the connector positions filtered by direction = In, the green arrow indicates the flow direction of each system.

This is the script I used, borrowed and adapted from this topic:
I hope that somehow I’m overlooking something obvious, because I’m starting to run out of ideas… any help appreciated :slight_smile:

Could hou share that rvt file? then I could take a closer look it.

@T_Pover I think @Bram_Weinreder1 using Fabrication Parts.

1 Like

No fabrication parts. Just regular ducts, duct fittings, an air terminal configured as an extraction fan, and on the right side pipes, a pipe fitting, and a plumbing fixture configured as a drain. Both have a flow, both show a flow direction in the inspector.
test stroomrichting.rvt (1.4 MB)
(Warning: Dutch content ;))

Dynamo script:
test stroomrichting.dyn (15.4 KB)

Dutch is geen probleem :slight_smile:
There must be something wrong with your workflow. I did a little check and expanded upon my previous code and also extracted the corresponding location of the connectors:

In this case the left connector is set to ‘Out’.
I’ll take a closer look at your .dyn and figure out the problem

Fixed it. Combined the 4 Python scripts into one, so probably the same script doesn’t always treat the connectors in the same order (although it didn’t affect the connector positions).
Probably not the most efficient way to extract the products of the co-ordinates, but it was the quickest way I could think of to use the output for new co-ordinates.
This does what I want, the issue is now resolved. Thank you for your time.

That’s great! I did just finish another solution, might be useful some other time :slight_smile:
test stroomrichting v2.dyn (9.5 KB)

This is much more elegant and does the trick just right :slight_smile: thanks a lot!

1 Like