I am attempting to write a script that Adds XY data via arcpy.AddXY_management tool, then takes the data from the tool generated XY points and appends fields ("coordinateX" and "coordinateY") that already exist in the feature classes. After appending these fields, I'd like to delete the fields that were generated by the Add XY tool. This should iterate through all feature classes in a given file geodatabase. When I run the below code, I get this error:
"ERROR 000732: Input Features: Dataset C:\Users\ANCGIS\Desktop\ANC\Resources\Test\MartinezUtiliyData.gdb does not exist or is not supported
Failed to execute (AddXY)"
I assume this error has to do with my "full_path_to_fc" variable, but I am not sure what a work around would be. Is there a way to write this code in a way that would fall in line with what I need? Thanks.
arcpy.env.overwriteOutput = True
arcpy.env.workspace = 'C:\Users\ANCGIS\Desktop\ANC\Resources\Test\MartinezUtiliyData.gdb'
fclist = arcpy.ListFeatureClasses(feature_type='Point')
full_path_to_fc = os.path.join(arcpy.env.workspace)
for fc in fclist:
with arcpy.da.UpdateCursor(full_path_to_fc, ["coordinateX", "coordinateY", "POINT_X", "POINT_Y"]) as rows:
for row in rows:
row = row
row = row