Creating of dimensions for MEP Elements (Ducts)

Hi Everyone ,
I’m trying to make dynamo script that is making dimension for some ducts from wall.
i’m getting some results for some ducts but others are not tagged with the dimensions ,
i’ve double checked with the flow of the script and the reason as i believe that in some cases the node (geometry distance to) measure the distance between some ducts and wall that is prependicular to it so any ideas how to limit the choosing to the parallel wall so i can gurantee to make the correct dimension.

if this is not the reason , please support me where is the issue.


this is the result that i got and some ducts as shown (??) are not dimensioned , i believe because they selected the neareast wall prependicular

you will have to get the wall directions and the piping/duct directions and group the elements by the vectors that are parallel to each other. then from that use your distance checker and go from there.

Thanks , Staylor,
i’ve made it with separation between the y parallel direction and x parallel direction & it succeeded to do the required.