Activate Add-In Tool

103
1
06-03-2011 08:44 AM
Highlighted
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!
Reply
0 Kudos
1 Reply
Highlighted
MVP Honored 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
Reply
0 Kudos