Skip to main content
Added language tag
Source Link
Hornbydd
  • 44.6k
  • 5
  • 42
  • 84

Block:

def plineZ(shp):
 arr=arcpy.Array();pM=arcpy.Point()
 part=shp.getPart(0);n=len(part)
 for i in xrange(n):
  p=part.getObject(i)
  pM.X=p.X;pM.Y=p.Y;pM.Z=p.Z+2*0.33
  arr.add(pM)
 return arcpy.Polyline(arr)
def plineZ(shp):
 arr=arcpy.Array();pM=arcpy.Point()
 part=shp.getPart(0);n=len(part)
 for i in xrange(n):
  p=part.getObject(i)
  pM.X=p.X;pM.Y=p.Y;pM.Z=p.Z+2*0.33
  arr.add(pM)
 return arcpy.Polyline(arr)

Expression:

plineZ( !Shape! )

Run it on Shape field using backup copy of feature class. Works for single part polylines only

Block:

def plineZ(shp):
 arr=arcpy.Array();pM=arcpy.Point()
 part=shp.getPart(0);n=len(part)
 for i in xrange(n):
  p=part.getObject(i)
  pM.X=p.X;pM.Y=p.Y;pM.Z=p.Z+2*0.33
  arr.add(pM)
 return arcpy.Polyline(arr)

Expression:

plineZ( !Shape! )

Run it on Shape field using backup copy of feature class. Works for single part polylines only

Block:

def plineZ(shp):
 arr=arcpy.Array();pM=arcpy.Point()
 part=shp.getPart(0);n=len(part)
 for i in xrange(n):
  p=part.getObject(i)
  pM.X=p.X;pM.Y=p.Y;pM.Z=p.Z+2*0.33
  arr.add(pM)
 return arcpy.Polyline(arr)

Expression:

plineZ( !Shape! )

Run it on Shape field using backup copy of feature class. Works for single part polylines only

Source Link
FelixIP
  • 23.3k
  • 3
  • 31
  • 62

Block:

def plineZ(shp):
 arr=arcpy.Array();pM=arcpy.Point()
 part=shp.getPart(0);n=len(part)
 for i in xrange(n):
  p=part.getObject(i)
  pM.X=p.X;pM.Y=p.Y;pM.Z=p.Z+2*0.33
  arr.add(pM)
 return arcpy.Polyline(arr)

Expression:

plineZ( !Shape! )

Run it on Shape field using backup copy of feature class. Works for single part polylines only