Activate Add-In Tool

316
1
06-03-2011 08:44 AM
TimGiguere
New Contributor
I have a class that inherits from Desktop.AddIns.Tool. I just want to be able to activate this tool from a button on my form, rather than having to activate it from the Toolbar. I can't use ITool because our users won't be able to use RegAsm on their machines. Essentially, I just need to know what the equivalent to using CurrentTool is for an add-in.

Thanks!
0 Kudos
1 Reply
KenBuja
MVP Esteemed Contributor
You can set the current tool like this:

Dim pUID As New ESRI.ArcGIS.esriSystem.UID
        Dim pCommandItem As ESRI.ArcGIS.Framework.ICommandItem

            pUID.Value = My.ThisAddIn.IDs.DrawTool 'Substitute in the name of your tool
            pCommandItem = m_application.Document.CommandBars.Find(pUID, False, False)
m_application.CurrentTool = pCommandItem
0 Kudos