Hi Robin,
To solve your problem, you can first use split lines at vertice tool to explose your polyline to segment. The following step is to use this script on the calculate field:
Code:
Parser:
Python
Expression:
GetAzimuthPolyline( !Shape!)
Code Block:
import math
def GetAzimuthPolyline(shape):
radian = math.atan((shape.lastpoint.x - shape.firstpoint.x)/(shape.lastpoint.y - shape.firstpoint.y))
degrees = radian * 180 / math.pi
return degrees
Now you have angle for each line in the new feature class.
Hope that help you,
Best regards,
Bookmarks