Monday, 13 June 2016

arcmap - Listening to ICommandBar or ICommand OnClick event?


I have an ArcMap extension and I'm listening to the IEditEvents.


When the OnChangeFeature, OnCreateFeature or OnDeleteFeature event is called, I want to know if it came from the "merge(Editor_Merge)" button.


Is there a way I can listen to the onClick event of the merge button?



Answer



Try implementing ICustomizationFilter. When OnCustomizationEvent is called, check to see if it is esriCEInvokeCommand. If it is, then you should be able to cast the object passed as an ICommandItem. Check to see if the ICommmandItem references the Editor_Merge command (using ICommandItem.ID). If it does, set a flag in your extension so that your eventhandler for edit events can know how to react.



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...