Guest User

Untitled

a guest
Apr 19th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. def RotateExtend(plyP,sLength):
  2. l=plyP.length
  3. ptX=plyP.positionAlongLine (l/2).firstPoint
  4. ptX0=plyP.firstPoint
  5. ptX1=plyP.lastPoint
  6. dX=float(ptX1.X)-float(ptX0.X)
  7. dY=float(ptX1.Y)-float(ptX0.Y)
  8. lenV=math.sqrt(dX*dX+dY*dY)
  9. sX=-dY*sLength/lenV;sY=dX*sLength/lenV
  10. leftP=arcpy.Point(ptX.X+sX,ptX.Y+sY)
  11. rightP=arcpy.Point(ptX.X-sX, ptX.Y-sY)
  12. array = arcpy.Array([leftP,ptX])
  13. section=arcpy.Polyline(array)
  14. return section
  15. #-----------------
  16. RotateExtend( !Shape!, ! !SHIFT!)
Add Comment
Please, Sign In to add comment