Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Import system modules
- import arcpy
- import os
- # Set local variables
- datasource = r"C:/Alexsomeplace"
- inTable = os.path.join(datasource, "Murray Sp2.shp")
- fieldName = "DipDir"
- fidField = arcpy.AddFieldDelimiters(datasource, "FID")
- def Strike(shape, fid):
- degreeBearing = 55
- arcpy.MakeFeatureLayer_management(inTable, 'shapelyr', "{0} = {1}".format(fidField, fid))
- arcpy.Delete_management('shapelyr')
- #returns the degreebearing value as the dip direction
- return degreeBearing
- with arcpy.da.UpdateCursor(inTable, ['SHAPE@', 'FID', fieldName]) as cursor:
- for row in cursor:
- row[2] = Strike( row[0], row[1])
- cursor.updateRow(row)
- del cursor
- arcpy.MakeFeatureLayer_management(inTable, 'shapelyr')
- def Strike(shape, fid):
- degreeBearing = 55
- arcpy.SelectLayerByAttribute_management('shapelyr', 'NEW_SELECTION', "{0} = {1}".format("FID", fid))
- arcpy.Delete_management('shapelyr')
- #returns the degreebearing value as the dip direction
- return degreeBearing
- with arcpy.da.UpdateCursor(inTable, ['SHAPE@', 'FID', fieldName]) as cursor:
- for row in cursor:
- row[2] = Strike( row[0], row[1])
- cursor.updateRow(row)
Add Comment
Please, Sign In to add comment