Rotating specific elements


I am currently working on a Dynamo script that can place hangers along cable trays in buildings. All you have to do is to select the cable trays and the script automatically places the hangers from a set of rules.

However I am having trouble rotating specific hangers, as you can see in the picture.
I have been trying to do something like; if the vector of the line is pointing one away, then rotate the family, but I havent been able to make it work yet, so I hope you have some suggestions.
The hangers are placed by giving the cable trays a curve which is then divided into points where a specific Family is placed.

There may be some helpful tips in this thread. :grinning:

1 Like

@kristian.brink, try out this one:

Thanks for the replies, but it wasn’t quite what I was looking for.
I ended up differentiating between the hangers to be rotated, and those not to be rotated, by examining their vectors, and then splitting them into two lists as you can see in the picture bellow.