I have a problem with turning on or off ArcMap editor, using arcpy.

When I try to turn on editor on arcpy I use this code on ArcMap Python window

workspace = r'C:\tests\test.mdb'        
edit = arcpy.da.Editor(workspace)

But it doesn't activate editor. When I do this process with using Editor - Start Editing on Arcmap, I try to test it with this code :

workspace = r'C:\tests\test.mdb'
edit = arcpy.da.Editor(workspace)
xa = edit.isEditing()
print xa

It returns False, Although editing is on.

I need to deactivate editor in my Python add-in script. So, i have to use arcpy.

1 Answer 1


This is not possible with arcpy.da.Editor. Actually, the only way to control edit session is to use ArcObjects (IEditor Interface). It is possible to do with Python using Comtypes (Accessing Arcobjects From Python)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.