<?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: Deactivate add-in Tool in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/deactivate-add-in-tool/m-p/435933#M11802</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;ArcGIS 10.0 Tool Add-in.&lt;BR /&gt;&lt;BR /&gt;ITool has a deactivate method that is called by the system when you click on another tool from the previous tool in use.&amp;nbsp; How can I call that deactivate method?&amp;nbsp; I can't seem to find a class that returns a reference to Tool.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Shouldn't you just set the 'CurrentTool?'&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Feb 2012 15:32:16 GMT</pubDate>
    <dc:creator>GeorgeFaraj</dc:creator>
    <dc:date>2012-02-03T15:32:16Z</dc:date>
    <item>
      <title>Deactivate add-in Tool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/deactivate-add-in-tool/m-p/435932#M11801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;ArcGIS 10.0 Tool Add-in.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ITool has a deactivate method that is called by the system when you click on another tool from the previous tool in use.&amp;nbsp; How can I call that deactivate method?&amp;nbsp; I can't seem to find a class that returns a reference to Tool.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Feb 2012 13:27:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/deactivate-add-in-tool/m-p/435932#M11801</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2012-02-03T13:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Deactivate add-in Tool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/deactivate-add-in-tool/m-p/435933#M11802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;ArcGIS 10.0 Tool Add-in.&lt;BR /&gt;&lt;BR /&gt;ITool has a deactivate method that is called by the system when you click on another tool from the previous tool in use.&amp;nbsp; How can I call that deactivate method?&amp;nbsp; I can't seem to find a class that returns a reference to Tool.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Shouldn't you just set the 'CurrentTool?'&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Feb 2012 15:32:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/deactivate-add-in-tool/m-p/435933#M11802</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2012-02-03T15:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Deactivate add-in Tool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/deactivate-add-in-tool/m-p/435934#M11803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Maybe you are right.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My tool add-in resides in this package: &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Consolas;"&gt;com.esri.arcgis.addins.desktop.Tool&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; Which means I can't cast anything like ICommand to my add-in tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;&lt;SPAN style="color: #000000; font-family: Consolas;"&gt;java.lang.ClassCastException: com.esri.arcgis.systemUI.ICommandProxy cannot be cast to com.esri.arcgis.addins.desktop.Tool&lt;/SPAN&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When you "set the Curent Tool", do you use the execute method on CommandItem?&amp;nbsp; I don't see an 'activate' method on CommandItem.&amp;nbsp; Or what is the way to set the current tool?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would have thought I could just call the deactivate() method since my class extends Tool and implements that method which is in the com.esri.arcgis.addins.desktop.Tool package.&amp;nbsp; Nothing happens when I call deactivate.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Feb 2012 15:49:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/deactivate-add-in-tool/m-p/435934#M11803</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2012-02-03T15:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: Deactivate add-in Tool</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/deactivate-add-in-tool/m-p/435935#M11804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;All Engine myself so I don't know the ins-and-outs of extensions but the 'CurrentTool' is a property of IApplication (and the MapControl and Toolbar and so on.) I suspect you should use something derived from IApplication, like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
IApplication app = GetMeSomehow();
app.CurrentTool = null; // (or 'Nothing' if VB)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:31:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/deactivate-add-in-tool/m-p/435935#M11804</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2021-12-11T19:31:51Z</dc:date>
    </item>
  </channel>
</rss>

