1

I'm developing a tool that, when the user creates a feature in a certain feature class, prompts the user with a form to populate one of the fields in its attribute table. I'd like to have the user use the Editor sketch tool to create the feature, rather than creating my own implementation of the sketch tool, and the form should appear only when the tool is active.

How do I keep my custom tool activated and allow the user to use the sketch tool at the same time?

Normally, a tool is deactivated when you switch to using another tool.

Following Preventing user from selecting different tool when custom tool is selected?, I looked at the ITool.Deactivate method, but according to the ArcObjects documentation, setting Deactivate to False makes it so that the user cannot select another tool.

I'm using and developing against ArcGIS 10.2.

  • I'd need to see some code but that doesn't sound like a problem. You will need to respond to IEditEvents to repopulate the form for each new feature created by the user... yes, when you switch tools yours becomes inactive but you can still respond to events - or not make it a tool, just a button that launches a form, then in the form load event wire the IEditEvents. – Michael Stimson Jun 19 '15 at 23:25
  • No code yet, but I will add some when I have it working. I had considered using a button to toggle a boolean variable (which I would then check for in the edit extension prior to firing the code to show the form), but a tool seemed like the more "elegant" approach. Now it seems that the button may be the easier way. Thanks! – Mwinslett Jun 23 '15 at 22:13
  • You only need to create a tool if you want to get mouse click events, if you're not going to use interactivity then a simple button is the way to go. You can have some control over the enabled of the button so that it's only available if you are editing... the difficult part is getting the form to reference ArcObjects. – Michael Stimson Jun 23 '15 at 23:18

Browse other questions tagged or ask your own question.