AnsweredAssumed Answered

ArcMap arcpy Add-In Editing Using da.UpdateCursor with Undo/Redo Stack

Question asked by simons.joseph on Apr 23, 2019

I am trying to build a series of arcpy Add-In buttons for ArcMap 10.6 that perform simple field calculations via da.updateCursor on selected annotation features in an ArcMap edit session. I have all the edit code working, however after an edit occurs, the standard Undo/Redo stack is not enabled and I need these edits to participate in the Undo/Redo stack. These are standard Feature Class annotation edits on the table itself, so they should behave like any other feature class edit on a data row.


I'd prefer to have to avoid building these in C# with ArcObjects. Is there a way to access the standard editing undo/redo stack (for File Geodatabase environments) during an ArcMap editing session using an arcpy Add-In natively without (1) accessing ArcObjects via comtypes/snippets, or (2) building it directly with ArcObjects? Also, (3) is it necessary to use arcpy with an Application Extension and accessing the onChangeFeature(self) ?


Note that I do not want to create a separate Undo/Redo stack for these edits, independent of the other edits in the ArcMap session, as suggested here.


Any advice would be appreciated.