2

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)
edit.startEditing()
edit.startOperation()

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.

Vince
20.5k16 gold badges49 silver badges65 bronze badges
asked Sep 5, 2017 at 10:46

1 Answer 1

2

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)

answered Sep 5, 2017 at 13:24

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.