Dimension Family both horizontal and vertical

Hi,
I made a script to dimension my plate family but since it based on coordinates it only works if the plate is placed on a horizontal plan. If I also want it to be abel to dimension it if it is placed vertical is there a node to check the orientation of the host/work plane? or any ides how to proceed?
DimensionPlate_B-L.dyn (98.0 KB)
Project1_Test_Plate_Dimension2.rvt (2.2 MB)