I
solved it (or it seems) by swopping firstpoint and lastpoint in the following way:
180+math.atan2(( !Shape.firstpoint.X! - !Shape.lastpoint.X! ),( !Shape.firstpoint.Y! -
!Shape.lastpoint.Y! ) ) * (180 / math.pi )
It seems to me that it returns exactly the deviation from North!!
Please check this out
Cheers
Marco Rusmini