<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Addin Tool Deactivate in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/addin-tool-deactivate/m-p/424235#M33289</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In a Python Add-In, calling the &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;deactivate()&lt;/SPAN&gt;&lt;SPAN&gt; method WILL NOT deactivate the add-in, only the user can. &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;deactivate()&lt;/SPAN&gt;&lt;SPAN&gt; is called to notify the tool class when the user has selected another tool (such as pan, zoom, etc) in the application as a triggered event.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Feb 2014 17:20:05 GMT</pubDate>
    <dc:creator>JasonScheirer</dc:creator>
    <dc:date>2014-02-10T17:20:05Z</dc:date>
    <item>
      <title>Addin Tool Deactivate</title>
      <link>https://community.esri.com/t5/python-questions/addin-tool-deactivate/m-p/424234#M33288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have an addin that includes a Tool. According to the documentation: &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Tool/014p00000027000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#/Tool/014p00000027000000/&lt;/A&gt;&lt;SPAN&gt; there is a function "deactivate" that "Causes the tool to no longer be the active tool."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do you cause this function to "deactivate" the tool?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At the end of the onMouseDownMap function I need to call the "deactivate" function, i.e. self.deactivate&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The documentation does not help any, nor did a call to support.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
class ToolClass3(object):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """Implementation for CPIC_Territory_addin.tool (Tool)"""
&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.enabled = True
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.shape = "NONE" 

&amp;nbsp;&amp;nbsp;&amp;nbsp; def onMouseDownMap(self, x, y, button, shift):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ##stuff happens here
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.deactivate

&amp;nbsp;&amp;nbsp;&amp;nbsp; def deactivate(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.&amp;lt;make the tool deactivate&amp;gt;

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:08:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addin-tool-deactivate/m-p/424234#M33288</guid>
      <dc:creator>KeithSandell1</dc:creator>
      <dc:date>2021-12-11T19:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Addin Tool Deactivate</title>
      <link>https://community.esri.com/t5/python-questions/addin-tool-deactivate/m-p/424235#M33289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In a Python Add-In, calling the &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;deactivate()&lt;/SPAN&gt;&lt;SPAN&gt; method WILL NOT deactivate the add-in, only the user can. &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;deactivate()&lt;/SPAN&gt;&lt;SPAN&gt; is called to notify the tool class when the user has selected another tool (such as pan, zoom, etc) in the application as a triggered event.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2014 17:20:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addin-tool-deactivate/m-p/424235#M33289</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2014-02-10T17:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Addin Tool Deactivate</title>
      <link>https://community.esri.com/t5/python-questions/addin-tool-deactivate/m-p/424236#M33290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;In a Python Add-In, calling the &lt;SPAN style="font-family:Courier New;"&gt;deactivate()&lt;/SPAN&gt; method WILL NOT deactivate the add-in, only the user can. &lt;SPAN style="font-family:Courier New;"&gt;deactivate()&lt;/SPAN&gt; is called to notify the tool class when the user has selected another tool (such as pan, zoom, etc) in the application as a triggered event.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the documentation is wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"Causes the tool to no longer be the active tool."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then how can I programmatically deactivate the tool at the end of the onMouseDownMap function?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2014 17:36:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addin-tool-deactivate/m-p/424236#M33290</guid>
      <dc:creator>KeithSandell1</dc:creator>
      <dc:date>2014-02-10T17:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: Addin Tool Deactivate</title>
      <link>https://community.esri.com/t5/python-questions/addin-tool-deactivate/m-p/424237#M33291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jason is right. You can't. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The documentation is not wrong per-se, it's just misleading. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;deactivate() is not a function that's intended for you (the programmer) to leverage. It's a function leveraged by the application so that ESRI tools can deactive it when they are selected. Otherwise, you'd never be able to select another tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In order to do what you're trying to do, you'd also need some sort of activate() function in order to default back to another tool like the cursor or pan tool because one tool always has to be active. Currently, there is no programmatic way to switch between tools that I know of.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 12:29:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/addin-tool-deactivate/m-p/424237#M33291</guid>
      <dc:creator>JohnDye</dc:creator>
      <dc:date>2014-02-11T12:29:03Z</dc:date>
    </item>
  </channel>
</rss>

