Dockable Window Button as Tool

353
2
05-31-2019 07:21 AM
M_DJohnson
Occasional Contributor

We have dockable window with textbox and a button. The button run click event but need this button as a tool to capture polygon then update the attribute value in the polygon featureclass field. 

0 Kudos
2 Replies
M_DJohnson
Occasional Contributor

As per another forum discussion created a class 'Draw Tool : ESRI.ArcGIS.Desktop.AddIns.Tool' added 'Draw Tool' in 'Config.esriaddinx' under commands

<Button id="DataCapture_DrawTool" class="DrawTool"...>
Then get the IDs.DrawTool

button click event code:
Snippet
UIDClass uid = new UIDClass(); uid.Value = ThisAddIn.IDs.DrawTool; ICommandItem commandItem = ArcMap.Application.Document.CommandBars.Find(uid, falsefalse); ArcMap.Application.CurrentTool = commandItem;

At last line it thrown an error.

Error description: An unhandled exception of type 'System.ArgumentException' occurred in DataCapture.dll
Additional information: Value does not fall within the expected range

Appreciate your help in advance.

0 Kudos
M_DJohnson
Occasional Contributor

No one here

0 Kudos