Get revit shaft opening rotation

Hello community,

Revit shaft opening doesn’t allow me to create a desired graphical representation so I created a 2D family for it. Now, I am trying to set my dynamo graph to place the detail item over the shaft opening. Everything works perfectly until the shaft is rotated.

My approach is to create a Bbox from the opening, find it’s center, place detail family with the same dimension. Problem is that Bbox does not rotate with the element.

I tried Location+ node from Clockwork and GetElementRotation from Modelical package. None of them work because they require a family instance not an element. I also tried to play with OOTB nodes AngleAboutAxis and AngleWithVector but I failed

My idea is to find the rotation of the shaft opening and fill in the FanilyInstance.SetRotation node. I am in 2.0.2 version.

Can anyone help please?

CUT_Shaft opening to 2D representation.dyn (68.8 KB)
CUT_Shaft opening to 2D representation.rvt (1.5 MB)