<?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 Best practise for using the IGeoProcessor Exist method in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/best-practise-for-using-the-igeoprocessor-exist/m-p/176583#M4566</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have developed some code that uses the IGeoProcessor object. It was bombing out when I was adding a Toolbox with an incorrect path. I realised my mistake and decided to add a bit of error trapping by using the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Exist &lt;/SPAN&gt;&lt;SPAN&gt;method to check if the toolbox exists before trying to add it to the GeoProcessor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So my code looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Dim pGP As IGeoProcessor2
pGP = New GeoProcessor
If pGP.Exists("C:\temp\test.tbx", "Toolbox") Then
&amp;nbsp;&amp;nbsp; pGP.AddToolbox("C:\temp\test.tbx")
End If&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the help it says:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Test the existence of a given parameter value (GPValue or catalog path) &lt;STRONG&gt;the type of the data is optional.&lt;/STRONG&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So my catalog path is obviously C:\temp\test.tbx but my data type is not optional I have to put something there. I tried &lt;/SPAN&gt;&lt;STRONG&gt;Nothing&lt;/STRONG&gt;&lt;SPAN&gt; and even a string that contains nothing or any text I like. So the line of code below is accepted and runs without error returning true (as the toolbox exists).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;pGP.Exists("C:\temp\test.tbx", "Duncan is ace")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So what do all the developers have to say about this? What should I put there for the non-optional parameter? I could just put &lt;/SPAN&gt;&lt;STRONG&gt;Nothing&lt;/STRONG&gt;&lt;SPAN&gt; or maybe I should put something sensible, but the Help gives NO help about what possible value I should put there, it says it should be a variant that represents pDataType. There is an interface call IGPDataType but as I can put anything there I find myself wondering what should really go there?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 09:05:38 GMT</pubDate>
    <dc:creator>DuncanHornby</dc:creator>
    <dc:date>2021-12-11T09:05:38Z</dc:date>
    <item>
      <title>Best practise for using the IGeoProcessor Exist method</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/best-practise-for-using-the-igeoprocessor-exist/m-p/176583#M4566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have developed some code that uses the IGeoProcessor object. It was bombing out when I was adding a Toolbox with an incorrect path. I realised my mistake and decided to add a bit of error trapping by using the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Exist &lt;/SPAN&gt;&lt;SPAN&gt;method to check if the toolbox exists before trying to add it to the GeoProcessor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So my code looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Dim pGP As IGeoProcessor2
pGP = New GeoProcessor
If pGP.Exists("C:\temp\test.tbx", "Toolbox") Then
&amp;nbsp;&amp;nbsp; pGP.AddToolbox("C:\temp\test.tbx")
End If&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the help it says:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Test the existence of a given parameter value (GPValue or catalog path) &lt;STRONG&gt;the type of the data is optional.&lt;/STRONG&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So my catalog path is obviously C:\temp\test.tbx but my data type is not optional I have to put something there. I tried &lt;/SPAN&gt;&lt;STRONG&gt;Nothing&lt;/STRONG&gt;&lt;SPAN&gt; and even a string that contains nothing or any text I like. So the line of code below is accepted and runs without error returning true (as the toolbox exists).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;pGP.Exists("C:\temp\test.tbx", "Duncan is ace")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So what do all the developers have to say about this? What should I put there for the non-optional parameter? I could just put &lt;/SPAN&gt;&lt;STRONG&gt;Nothing&lt;/STRONG&gt;&lt;SPAN&gt; or maybe I should put something sensible, but the Help gives NO help about what possible value I should put there, it says it should be a variant that represents pDataType. There is an interface call IGPDataType but as I can put anything there I find myself wondering what should really go there?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:05:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/best-practise-for-using-the-igeoprocessor-exist/m-p/176583#M4566</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-12-11T09:05:38Z</dc:date>
    </item>
  </channel>
</rss>

