arcpy: table is not editable

120
2
Jump to solution
07-09-2021 08:21 AM
MatthiasHa
New Contributor

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!

 

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

Did you try...

arcpy.Copy_management(fileName + ".shp", fileName + "XY.shp")
arcpy.AddXY_management(fileName + "XY.shp")

... sort of retired...

View solution in original post

2 Replies
DanPatterson
MVP Esteemed Contributor

Did you try...

arcpy.Copy_management(fileName + ".shp", fileName + "XY.shp")
arcpy.AddXY_management(fileName + "XY.shp")

... sort of retired...
MatthiasHa
New Contributor

Ahh now I see my mistake...

Thank you!

0 Kudos