Select to view content in your preferred language

Get selected menu option from context menu

4068
4
05-14-2015 10:52 AM
soniadickerson1
Regular Contributor

I'm converting a 9.3.1 esri desktop extension to a 10.2.2 addin and have a split tool that leaves a temporary line when the user right-clicks in the map to get the context menu and selects the delete sketch option.

This is what it leaves:

Here's the context menu

contextmenu.png

How do I tell when the user selects the delete sketch option from this menu?

Thanks very much.

Sonia

0 Kudos
4 Replies
TeroRönkkö
Regular Contributor

I am not sure what you are asking - do you want to catch event that happens WHEN the user presses that button? or when the magic happens?

ArcObjects 10 .NET SDK Help

0 Kudos
DuncanHornby
MVP Notable Contributor

To add to Tero's question, the first image above it looks like a graphic has been drawn not a sketch, which is it?

0 Kudos
soniadickerson1
Regular Contributor

When the user selects the delete sketch option, I want to call the OnDeactivate method which just clears all of the variables and refreshes the view.

Duncan asked about the image- yes, the line is a sketch.

0 Kudos
soniadickerson1
Regular Contributor

Here’s what I needed to do to fix the tools so that I'd get the correct menus and so the tool sketch would work properly.  I deprecated the old ones and built new ones with the coaching of one of the ESRI staff, Yuan.  Yeay for Yuan!

Right-click on the project and Add an item.  Select the ArcGIS desktop addins and then select the Add-in component.

AddinComponent.PNG

Select the construction tool.  For this particular tool I set it up to be a polyline.

AddinConstructionTool.PNG

Then add the custom methods to the tool methods.

0 Kudos