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.
2 Answers 2
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
-
1I'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.JC5577– JC55772014年09月09日 12:21:04 +00:00Commented Sep 9, 2014 at 12:21
Explore related questions
See similar questions with these tags.