select straight edge in drawing view and find angle

Hello,

I was wondering if anybody knows hot to get the angle of a preselect edge in a drawing view using a macro

I would like to make a rotate view macro that aligns an edge vertical or horizontal.

The built in function in SW doesn't work reliable.

thanks,

elmar

SolidworksApi macros