3

I have a vb.net arcmap addin which provide a function to validate geodb topology. But there is a problem, when I am not in editing session and use the function, arcmap will crash. In this case I intend to check whether the map is in editing session.

Is there a way to check whether arcmap is in editing session?

I am using vb.net and arcmap 10.2.

asked Sep 8, 2014 at 9:34

2 Answers 2

5

You can check for the EditState on the editor extension.

enter image description here

answered Sep 8, 2014 at 15:01
1
  • Thanks Jay, It works! I have put my code below in case it is useful. Commented Sep 9, 2014 at 3:06
1

After Jay's help, I have successfully check when arcmap is in editing session, the code is as floows:

 Dim editorUid As New UID()
 editorUid.Value = "esriEditor.Editor"
 m_editor = TryCast(My.ArcMap.Application.FindExtensionByCLSID(editorUid), IEditor3)
 m_editEvents = TryCast(m_editor, IEditEvents_Event)
 If m_editor.EditState = esriEditState.esriStateNotEditing Then
 MsgBox("You must in editing session to validate the topology")
 End If
answered Sep 9, 2014 at 3:08
1
  • 1
    I'm not familiar with the VB AddIn's but for CSharp, the first 3 lines are duplicate what is in the ArcMap class (internal static class found in your AddIn's namespace), which already exposes an IEditor for AddIn editor extensions. Commented Sep 9, 2014 at 12:21

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.