Hello,
I just tried to edit a shapefile inside python, but all I get is ERROR 000499: table is not editable. The strange thing is: I can edit the shapefile in arcMap, it just wont work with arcpy. Also after I restarted my computer (so there is no lock on the file... ) Here's the code:
import arcpy
workspace = "W:/data/"
arcpy.env.workspace = workspace
filename = "measurePoints"
arcpy.Copy_management(fileName + ".shp", fileName + "XY.shp")
with arcpy.da.Editor(workspace) as edit:
arcpy.AddXY_management(fileName + "XY.shp")
I checked if the file is write-protected, but it isn't, since I just create it in the code.
If anybody has any ideas, I'd appreciate it very much!
best regards!
Solved! Go to Solution.
Did you try...
arcpy.Copy_management(fileName + ".shp", fileName + "XY.shp")
arcpy.AddXY_management(fileName + "XY.shp")
Did you try...
arcpy.Copy_management(fileName + ".shp", fileName + "XY.shp")
arcpy.AddXY_management(fileName + "XY.shp")
Ahh now I see my mistake...
Thank you!