Select to view content in your preferred language

arcpy.da.Editor setup for tool

2886
12
02-16-2017 03:29 PM
DevinUnderwood2
Occasional Contributor

I am not sure how I should have my syntax to use this with a tool ?

# Set Editing
workspace = r'C:\xyz'
edit = arcpy.da.Editor(workspace) 
edit.startEditing(False, True) 
edit.startOperation()
edit = arcpy.GetParameterAsText(3)

Tags (2)
0 Kudos
12 Replies
IanMurray
Frequent Contributor

Ah just tested that in a map document.  It opens an editting session in memory, but does not actually show the editting session within the map document itself.  I can edit the attribute table manually of the feature but can't manually edit geometry.  I thought the map document would recognize the edit session, but apparently not.

0 Kudos
DevinUnderwood2
Occasional Contributor

Interesting, I can't even edit in the attribute table.  

0 Kudos
IanMurray
Frequent Contributor

I didn't write out a whole script tool to use, I just entered all the values in ArcMap's python window.

Also interesting is when I opened and closed an editing session within the map document manually, it closed out my in memory editting session.  Apparently their aren't many pythonic ways to get a map document to check if there is an edit session ongoing.  Found a few other threads that could point you in the right direction, but I'm not sure using arcpy.da.Editor is going to do the trick by itself.

http://gis.stackexchange.com/questions/61708/how-to-check-via-arcpy-if-arcmap-is-currently-in-an-edi...

If anyone else has some suggestions, I'm all ears.