Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def RotateExtend(plyP,sLength):
- l=plyP.length
- ptX=plyP.positionAlongLine (l/2).firstPoint
- ptX0=plyP.firstPoint
- ptX1=plyP.lastPoint
- dX=float(ptX1.X)-float(ptX0.X)
- dY=float(ptX1.Y)-float(ptX0.Y)
- lenV=math.sqrt(dX*dX+dY*dY)
- sX=-dY*sLength/lenV;sY=dX*sLength/lenV
- leftP=arcpy.Point(ptX.X+sX,ptX.Y+sY)
- rightP=arcpy.Point(ptX.X-sX, ptX.Y-sY)
- array = arcpy.Array([leftP,ptX])
- section=arcpy.Polyline(array)
- return section
- #-----------------
- RotateExtend( !Shape!, ! !SHIFT!)
Add Comment
Please, Sign In to add comment