<?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 Check if toolbox tool exists before opening it in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/check-if-toolbox-tool-exists-before-opening-it/m-p/806098#M2176</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a way to check if a toolbox tool exists before opening it using the arcgis pro sdk? When I tried OpenToolDialog()&amp;nbsp; on a tool not in the toolbox it tried to open it and failed.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;string analysisToolName = "C:\\Program Files\\ArcGIS\\Pro\\Resources\\ArcToolBox\\Toolboxes\\Analysis Tools.tbx\\NewToolBuffer";&lt;BR /&gt;&lt;BR /&gt; var param_values = Geoprocessing.MakeValueArray();&lt;BR /&gt; param_values = null;&lt;BR /&gt; if (File.Exists(analysisToolName))&lt;BR /&gt; {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Debug.WriteLine("FOUND");&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Geoprocessing.OpenToolDialog(analysisToolName, param_values);&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Debug.WriteLine("DID NOT FIND TOOL");&lt;BR /&gt; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 17 Aug 2019 20:36:21 GMT</pubDate>
    <dc:creator>MapVis</dc:creator>
    <dc:date>2019-08-17T20:36:21Z</dc:date>
    <item>
      <title>Check if toolbox tool exists before opening it</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/check-if-toolbox-tool-exists-before-opening-it/m-p/806098#M2176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a way to check if a toolbox tool exists before opening it using the arcgis pro sdk? When I tried OpenToolDialog()&amp;nbsp; on a tool not in the toolbox it tried to open it and failed.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;string analysisToolName = "C:\\Program Files\\ArcGIS\\Pro\\Resources\\ArcToolBox\\Toolboxes\\Analysis Tools.tbx\\NewToolBuffer";&lt;BR /&gt;&lt;BR /&gt; var param_values = Geoprocessing.MakeValueArray();&lt;BR /&gt; param_values = null;&lt;BR /&gt; if (File.Exists(analysisToolName))&lt;BR /&gt; {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Debug.WriteLine("FOUND");&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Geoprocessing.OpenToolDialog(analysisToolName, param_values);&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Debug.WriteLine("DID NOT FIND TOOL");&lt;BR /&gt; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Aug 2019 20:36:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/check-if-toolbox-tool-exists-before-opening-it/m-p/806098#M2176</guid>
      <dc:creator>MapVis</dc:creator>
      <dc:date>2019-08-17T20:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Check if toolbox tool exists before opening it</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/check-if-toolbox-tool-exists-before-opening-it/m-p/806099#M2177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/350210" target="_blank"&gt;Map Vis&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use a try/catch statement. &amp;nbsp;The exception can also be used to handle other specific error other than the tool not being loaded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;var param_values &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Geoprocessing&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;MakeValueArray&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
param_values &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; null&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt; 
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
   Geoprocessing&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;OpenToolDialog&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;analysisToolName&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; param_values&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;catch&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token class-name"&gt;Exception&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
   Debug&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;WriteLine&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"DID NOT FIND TOOL"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:23:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/check-if-toolbox-tool-exists-before-opening-it/m-p/806099#M2177</guid>
      <dc:creator>LanceCole</dc:creator>
      <dc:date>2021-12-12T09:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: Check if toolbox tool exists before opening it</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/check-if-toolbox-tool-exists-before-opening-it/m-p/806100#M2178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried this but when I run &lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: inherit; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;OpenToolDialog&lt;/SPAN&gt; it is not throwing an exception so it just finishes and I see this. Is there a way to throw an exception when Tool has failed to open happens?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/457336_Capture.PNG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Aug 2019 02:23:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/check-if-toolbox-tool-exists-before-opening-it/m-p/806100#M2178</guid>
      <dc:creator>MapVis</dc:creator>
      <dc:date>2019-08-19T02:23:42Z</dc:date>
    </item>
  </channel>
</rss>

