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.
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Rotating Reference Plane in Dynamo | 7 | 123 | June 14, 2023 | |
Aligning Elements | 2 | 169 | December 5, 2023 | |
Rotating the multiple elements against one point | 8 | 859 | May 16, 2019 | |
Rotate Elements at Different degrees | 2 | 100 | May 28, 2024 | |
ReferencePlane within Element | 3 | 3122 | March 23, 2021 |