You can run several geoprocessing tools that modify the input data in an edit session so that the changes to feature geometry or attributes can be undone. The Enable Undo toggle button on geoprocessing tools is a shortcut to start and leave an edit session active, specifically for use with geoprocessing tools that modify data.
Enable undo
Several tools including Calculate Field, Integrate, Append, Snap, Align Features, and others have an Enable Undo toggle button next to the Run button on the tool dialog box. When the Enable Undo option is on, the tool will use an edit session after you click the Run button. After the tool completes, the edit session will remain open, and you can undo the changes.
ArcGIS Pro automatically starts editing when you create or modify features in the map or enter or modify attributes in the attribute window or pane. Alternatively, you can start an edit session by setting the edit session options to enable editing tools.
Note:
Geoprocessing tools that add or delete fields, or perform other schema changes, cannot be run in an edit session. Some tools that support the Enable Undo toggle button may add a field and calculate values into the new field, such as Near. If you undo this tool, the field will not be removed from the data, but the contents of the field will be removed and set to <Null>.
Note:
Use the Enable Undo toggled on by default geoprocessing option to set the default state of the Enable Undo toggle button.
Undo and redo
After turning on the Enable Undo option and running a tool, evaluate the tool results to determine whether you want to keep the changes made to the data. A banner near the top of the tool dialog box indicates the pending edits.
To help you efficiently evaluate and visualize the changes made to the data, the banner includes an Undo button and a Redo button .
Save or discard changes
If you decide to keep the changes to the data made by the tool, click the Save Edits button to commit the edits. If you do not want to keep the changes, click the Discard Edits button to revert changes made by the tool.
If you do not save or discard your edits, other geoprocessing tools will be run in the open edit session, which can have unintended implications on performance and application behaviors. See the Considerations section below for more information.
Note:
Saving or discarding the edits closes the edit session started by running the geoprocessing tool. After saving or discarding the edits, you can no longer undo or redo the operation.
Manual edit sessions
When the Enable and disable editing from the Edit tab editing option is turned on, an Edit button on the ribbon's Edit tab will allow you to enable or disable editing. This option has the following impacts on the geoprocessing editing banner and Enable Undo toggle button:
- When editing is enabled on the Edit tab, the Enable Undo toggle button will be on but disabled since the edit session is controlled through the Edit button in the ribbon. Tools will run in an edit session, and you can undo the changes the tool made to the data. A banner at the top of the tool indicates any pending edits.
- When editing is disabled on the Edit tab, the Enabled Undo toggle button will be off and disabled. Tools can still be run, but they will not run in an edit session, and you will not be able to use undo. A banner at the top of the tool dialog box will indicate this and provide a shortcut to enable editing to run the tool in an edit session so you can use undo.
Considerations
When deciding to run geoprocessing tools with Enable Undo turned on, the following should be considered.
Threading
When geoprocessing tools are run in an edit session, the tools are run in the main application thread. This means that the application will be blocked from other tasks while the tool is running.
Performance and scalability
When geoprocessing tools are run in an edit session, performance will decrease compared to when the same tool is run outside an edit session. Similarly, scalability will decrease, as fewer features can be processed in an edit session compared to outside an edit session.
Schema tools
Geoprocessing tools that add or delete fields, such as Add Field, Alter Field, and Delete Field, cannot be run in an edit session.
Deleting or overwriting datasets
Geoprocessing tools that delete or overwrite datasets cannot be run in an edit session. You also cannot delete datasets from these locations in the Catalog pane using the right-click Delete command.