create line perpendicular to existing element

I am trying to create a line of a specific length that is perpendicular to a given point on a user-selected element.  Can any one tell me what functions will return either the perpendicular or tangent angle at that point on the element? This needs to work for any element type for which one can create a perpendicular, so I don't want to have to create a case statement by element type to get  this info if possible. FYI, the user of this vba will indicate with a datapoint which side of the selected element the new line will be created.

 

Thanks,

Stephanie