Set Rotation for Penetration angle based on Pipe angle

Hello,

Here is the attached my working script and Revit models for MEP and Arch (Linked Model).

I am able to place penetration family at the intersection of the walls (in Linked Model) and Pipes but unable to set orientation of placed family based on Pipe angle.

Any help on this issue is appreciated.

Thank YouPenetration-Pipe_04-03-2020.dyn|attachment (26.6 KB)