# Rotation of flanges added by dynamo

**URL:** <https://forum.dynamobim.com/t/rotation-of-flanges-added-by-dynamo/53470>\
**Category:** Revit\
**Created:** [July 28, 2020, 1:00pm UTC](https://forum.dynamobim.com/t/rotation-of-flanges-added-by-dynamo/53470 "2020-07-28T13:00:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jorgen.fidjeland](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jorgen.fidjeland](https://forum.dynamobim.com/u/jorgen.fidjeland)\
**Post date:** [July 28, 2020, 1:00pm UTC](https://forum.dynamobim.com/t/rotation-of-flanges-added-by-dynamo/53470/1 "2020-07-28T13:00:30Z")

</div>

Hi,

I’m trying to make a dynamo-script for adding flanges next to valves, pumps etc, as the routing preferences cannot be used for our purpose. I’m stuck regarding the rotation of the added flanges: How can I control the rotation of the flanges with dynamo? Currently the flanges are added by the FamilyInstance.ByPoint-node, but I cant figure out how to modify the rotation after the flange is added.

I tried using the node FamilyInstance.ByFace, but the flange family is not face-based, so it will not work.

I have extracted the wanted rotation of the flange as a vector by using Connector.Direction in the MEPover package, as this gives the direction of the connector element on the pump/valve. I just don’t know how to use this info to rotate the flange.

Any help is mostly appreciated!

---

<div class="post-metadata">

**Author:** ![Daan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/daan/32/82246_2.png) [@Daan](https://forum.dynamobim.com/u/Daan)\
**Post date:** [July 28, 2020, 3:06pm UTC](https://forum.dynamobim.com/t/rotation-of-flanges-added-by-dynamo/53470/2 "2020-07-28T15:06:42Z")

</div>

with the **FamilyInstance.SetRotation** node you can rotate families

---

<div class="post-metadata">

**Author:** ![jorgen.fidjeland](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jorgen.fidjeland](https://forum.dynamobim.com/u/jorgen.fidjeland)\
**Post date:** [July 29, 2020, 9:29am UTC](https://forum.dynamobim.com/t/rotation-of-flanges-added-by-dynamo/53470/3 "2020-07-29T09:29:20Z")

</div>

Thanks for the suggestion!

Unfortunately, this only rotates relative to the z-axis. So its fine if the pipe is excactly horizontal. But many piper are vertical or sloped. So this node does not really solve the problem.

---

<div class="post-metadata">

**Author:** ![jorgen.fidjeland](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jorgen.fidjeland](https://forum.dynamobim.com/u/jorgen.fidjeland)\
**Post date:** [July 29, 2020, 9:31am UTC](https://forum.dynamobim.com/t/rotation-of-flanges-added-by-dynamo/53470/4 "2020-07-29T09:31:28Z")

</div>

There is a node called FamilyInstance.FacingOrientation, which output a vector similar to the vector I get from the Connector.Direction-node. But FamilyInstance.FacingOrientation is a get-node, not a set-node, so it doesnt help. But I just mention it to illustrate what I want dynamo to do.

---

<div class="post-metadata">

**Author:** ![jorgen.fidjeland](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jorgen.fidjeland](https://forum.dynamobim.com/u/jorgen.fidjeland)\
**Post date:** [July 29, 2020, 12:28pm UTC](https://forum.dynamobim.com/t/rotation-of-flanges-added-by-dynamo/53470/5 "2020-07-29T12:28:49Z")

</div>

For info: I have found a node in the MEPover package called MEPfittings.ByPointsAndCurve that does the job. More discussion regarding this in the following thread: [Automate placing Pipe Accessory (Valves)](https://forum.dynamobim.com/t/automate-placing-pipe-accessory-valves/23552/26)
