Thursday 23 July 2015

arcobjects - How to make sure OnSketchFinished always works?


In my VBA application I have a listener set up that listens for OnSketchFinished, when the polygon is created a message box appears and then a userform.


My problem is that the listener will work 90% of the time, not 100%.


Here are the snippets of code in ThisDocument:


Private WithEvents EditEvents As Editor
Private m_pEditor As IEditor
Public Sub SetEvents()

' This is the listener for the Editor
Dim pID As New UID
pID = "esriEditor.Editor"
Set m_pEditor = Application.FindExtensionByCLSID(pID)
Set EditEvents = m_pEditor
End Sub

Private Function MxDocument_OpenDocument() As Boolean
Call SetEvents
End Function


Private Sub EditEvents_OnSketchFinished()
Call frmCityDev.EditEvents
End Sub

In my form I have code for EditEvents which brings up a msgbox to notify that a new polygon has been created.


Am I missing something to make sure that the listener will always work?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...