I have developed several toolbars but after some use I decided to try and add undo button to my tool bars. However, I am struggling to implement the arcpy undoOperation function in just the Arc Python window, let alone one of my toolbars. I have been trying workspace='E:\CLWNEZ\LFM_CLWNEZ\M6004\m6004_Classification_Base.gdb'
layer='m6004_Classification_Base'
edit = arcpy.da.Editor(workspace)
edit.startEditing(True, False)
edit.startOperation()
with arcpy.da.Editor(workspace) as edit:
arcpy.CalculateField_management(layer, "LFM", 5000, "PYTHON")
edit.undoOperation()
But I keep getting this error message when I run this in the Python window. Runtime error
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'Workspace Operation object' object has no attribute 'undoOperation'
I'm sure I'm doing something incorrect but not sure what yet. Fred