I am using ArcGIS Pro v3.0
I have written a script to perform a set of toolbox operations on a couple of layers in my map.
One thing I noticed was that more often than not I forget to save my edits before running the script and I get some errors as some of the operations cannot be performed whilst the layers are being edited.
What I have tried to do is therefore to find the command that emulates the following GUI "Save" button:
I've had a look at the ArcPy editor page, without success.
Here is the code I have written to try and save any unsaved edits and stop editing:
# I access the editor edit = arcpy.da.Editor(arcpy.env.workspace) # I check if the editor is currently active if edit.isEditing == True # If it is I close the editing session and save any outstanding changes edit.stopEditing(True)
But when I check for
edit.isEditing it always returns
False even when I clearly have some unsaved edits.
The workspace I use to instantiate the editor is the database where the layer files are stored. I tried specifying the individual features but that doesn't seem to work.
Ultimately the state I'm trying to get to is the one I get once I clicked the "Save" button above, followed by the "OK" on the pop-up below which results in all edits being saved and the "Save" button being greyed out.