Addin Tool Deactivate

Discussion created by keithsandell on Feb 10, 2014
Latest reply on Feb 11, 2014 by johnmdye
I have an addin that includes a Tool. According to the documentation: there is a function "deactivate" that "Causes the tool to no longer be the active tool."

How do you cause this function to "deactivate" the tool?

At the end of the onMouseDownMap function I need to call the "deactivate" function, i.e. self.deactivate

But the function will not fire until I force the tool to deactivate by clicking another tool manually, which leads me to believe this function is "listening" for deactivation, but is not "causing" deactivation.

The documentation does not help any, nor did a call to support.

class ToolClass3(object):
    """Implementation for CPIC_Territory_addin.tool (Tool)"""
    def __init__(self):
        self.enabled = True
        self.shape = "NONE" 

    def onMouseDownMap(self, x, y, button, shift):
        ##stuff happens here

    def deactivate(self):
        self.<make the tool deactivate>