How to Rotate an Element in Dynamo with Reference to Another Element?

If the two elements being compared are families and are aligned to the default family references (i.e. “Center Left/Right” or “Center Front/Back”), you can get those references and the corresponding planes from the references. Link below has the code and example for getting the references and planes. Use Plane.Normal to get the vectors of the planes and use the Vector.AngleAboutAxis node to compare return the angle between them. FYI, use the View.Direction for the rotation axis. From that point use the Element.SetRotation as you already have.

1 Like