"Start Editing" checkbox in python geoprocessing tool

734
6
04-09-2018 04:48 PM
SaurabhPandit
New Contributor II

Is it possible to have "Start Editing" checkbox in python geoprocessing tool like some tools provide such as 'Calculate Field'? What I really want is to edit input data and allow user to visualise the modifications before saving or discarding them.python geoprocessing arcgispro 2.1 

0 Kudos
6 Replies
DanPatterson_Retired
MVP Emeritus

What types of edits are being do that aren't in the editing toolbox?

http://pro.arcgis.com/en/pro-app/tool-reference/editing/an-overview-of-the-editing-toolbox.htm

Any other calculations or related functions should be done in newly added fields, or being saved to new featureclasses to avoid the multitude of problems that could arise with a failed 'undo'.  

Fields and featureclasses are easy to delete.  You could even provide access to them in your toolbox

0 Kudos
SaurabhPandit
New Contributor II

The geoprocessing tool I am working on modifies the geometry of the features, that's it, nothing else.

0 Kudos
DanPatterson_Retired
MVP Emeritus

Sorry, I am missing the point then as to why you would be using anything other than a conventional edit session for such purposes since you can abandon changes there.

0 Kudos
SaurabhPandit
New Contributor II

In Arcgis Pro, I don't think there is no way to explicitly start or stop an edit session. The custom geoprocessing tool I am developing performs some complex calculation to workout the adjustments that will be applied to the geometry. Within this tool I use arcpy.da.Editor object to start an edit session. But at the end of the modifications I only have option to stop editing with True(save changes) or False(discard changes). So when tool exits edits are either saved or discarded not allowing user to visualise changes beforehand.

0 Kudos
DanPatterson_Retired
MVP Emeritus

I don't see any 'map refresh' capabilities in arcpy or the toolbox editor tools that emulate what happens in an edit session... which you correctly point out... pro is always in an edit state

0 Kudos
SaurabhPandit
New Contributor II

Its actually Automatic Edit Sessions. Pro start edit session automatically when you start editing a feature and stops it when you click 'Save' or 'Discard', but unfortunately its not applicable for custom geoprocessing tools.

0 Kudos