I am trying to update the Z value of a polygon using update Cursor and it just doesn't work!
I have been exploring this site and trying different codes without success.
I have a shapefile with polygons that represents buildings, and some of the vertices have Z values, others have z=0.
What am I doing wrong?
import arcpy
sheet_name = "RPN_2609"
GDB_path = r"D:\Buildings_Height\Case_Study\Part_B\{}.gdb".format(sheet_name)
bldg = GDB_path + "//" + "RPN_2609_BLDG_No_Zero"
with arcpy.da.UpdateCursor(bldg, ["SHAPE@","OID@"]) as cursor:
for row in cursor:
for vertice in row[0]:
for pnt in vertice:
try:
if pnt.Z == 0:
pnt.Z = 1
cursor.updateRow(row)
except:
pass