<?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: pythonaddins.GPToolDialog() Missing? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/pythonaddins-gptooldialog-missing/m-p/735926#M57000</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I'm reading your code correctly, then your TBX file lives at the top-level inside of your 'Install' directory. When you build an add-in, the files inside of 'Install' are all placed into a GUID-based directory within your users' home directory, and any paths should be relative to this. You can read more about using files from the 'Install' directory in the documentation, under the heading "&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//014p0000001p000000" rel="nofollow noopener noreferrer" target="_blank"&gt;File and folder structure&lt;/A&gt;".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the path to the toolbox should be something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

toolPath = os.path.join(relPath, "getIR.tbx")


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way you can test this is by changing your code to just pop up a message box instead of executing the tool:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def onclick(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp; pythonaddins.MessageBox("toolPath is set to {}.".format(toolPath), "Expected Path")&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Shaun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 07:22:15 GMT</pubDate>
    <dc:creator>ShaunWalbridge</dc:creator>
    <dc:date>2021-12-12T07:22:15Z</dc:date>
    <item>
      <title>pythonaddins.GPToolDialog() Missing?</title>
      <link>https://community.esri.com/t5/python-questions/pythonaddins-gptooldialog-missing/m-p/735923#M56997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The script inside the toolbox works properly when running alone.&amp;nbsp; However when I open the toolbar in arcmap always a [Missing] Error.&amp;nbsp; The following is my entire add-in .py?&amp;nbsp; I cannot for the life of me figure out what is missing here?...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14066651964308793" jivemacro_uid="_14066651964308793"&gt;
&lt;P&gt;import os&lt;/P&gt;
&lt;P&gt;import arcpy&lt;/P&gt;
&lt;P&gt;import pythonaddins&lt;/P&gt;
&lt;P&gt;relPath = os.path.dirname(__file__)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;class ButtonClass1(object):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; """Implementation for Get IR Count_addin.button (Button)"""&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.enabled = True&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.checked = False&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def onClick(self):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; toolPath = relPath + r"\Custom Tools\Get IR Count\Install\GetIR.tbx"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pythonaddins.GPToolDialog(toolPath,"Get IR Count")&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 20:23:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pythonaddins-gptooldialog-missing/m-p/735923#M56997</guid>
      <dc:creator>NoahHuntington</dc:creator>
      <dc:date>2014-07-29T20:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: pythonaddins.GPToolDialog() Missing?</title>
      <link>https://community.esri.com/t5/python-questions/pythonaddins-gptooldialog-missing/m-p/735924#M56998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you print relpath to see if it contains forward slashes or is in raw form and contains a backslash at the end.&amp;nbsp; Also searching gptooldialog reveals some tips&amp;nbsp; ie&amp;nbsp;&amp;nbsp; &lt;A _jive_internal="true" href="https://community.esri.com/message/75339?sr=search&amp;amp;searchId=c4e4a943-1567-4d2e-802c-abdaefd98d40&amp;amp;searchIndex=3#75339" title="https://community.esri.com/message/75339?sr=search&amp;amp;searchId=c4e4a943-1567-4d2e-802c-abdaefd98d40&amp;amp;searchIndex=3#75339"&gt;https://community.esri.com/message/75339?sr=search&amp;amp;searchId=c4e4a943-1567-4d2e-802c-abdaefd98d40&amp;amp;searchIndex=3#75339&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 20:37:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pythonaddins-gptooldialog-missing/m-p/735924#M56998</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-07-29T20:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: pythonaddins.GPToolDialog() Missing?</title>
      <link>https://community.esri.com/t5/python-questions/pythonaddins-gptooldialog-missing/m-p/735925#M56999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for jumping in Dan! Here are my results...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;G:\Custom Tools\Get IR Count\Install&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which was not exactly as expected. I have revised and still missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14066666266913656" jivemacro_uid="_14066666266913656"&gt;
&lt;P&gt;import os&lt;/P&gt;
&lt;P&gt;import arcpy&lt;/P&gt;
&lt;P&gt;import pythonaddins&lt;/P&gt;
&lt;P&gt;relPath = os.path.dirname(__file__)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;class ButtonClass1(object):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; """Implementation for Get IR Count_addin.button (Button)"""&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.enabled = True&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.checked = False&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def onClick(self):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; toolPath = relPath + r"\GetIR.tbx"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pythonaddins.GPToolDialog(toolPath,"Get IR Count")&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 20:43:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pythonaddins-gptooldialog-missing/m-p/735925#M56999</guid>
      <dc:creator>NoahHuntington</dc:creator>
      <dc:date>2014-07-29T20:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: pythonaddins.GPToolDialog() Missing?</title>
      <link>https://community.esri.com/t5/python-questions/pythonaddins-gptooldialog-missing/m-p/735926#M57000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I'm reading your code correctly, then your TBX file lives at the top-level inside of your 'Install' directory. When you build an add-in, the files inside of 'Install' are all placed into a GUID-based directory within your users' home directory, and any paths should be relative to this. You can read more about using files from the 'Install' directory in the documentation, under the heading "&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//014p0000001p000000" rel="nofollow noopener noreferrer" target="_blank"&gt;File and folder structure&lt;/A&gt;".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the path to the toolbox should be something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

toolPath = os.path.join(relPath, "getIR.tbx")


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way you can test this is by changing your code to just pop up a message box instead of executing the tool:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def onclick(self):
&amp;nbsp;&amp;nbsp;&amp;nbsp; pythonaddins.MessageBox("toolPath is set to {}.".format(toolPath), "Expected Path")&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Shaun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:22:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pythonaddins-gptooldialog-missing/m-p/735926#M57000</guid>
      <dc:creator>ShaunWalbridge</dc:creator>
      <dc:date>2021-12-12T07:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: pythonaddins.GPToolDialog() Missing?</title>
      <link>https://community.esri.com/t5/python-questions/pythonaddins-gptooldialog-missing/m-p/735927#M57001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As well see &lt;A _jive_internal="true" href="https://community.esri.com/message/75339?sr=search&amp;amp;searchId=c4e4a943-1567-4d2e-802c-abdaefd98d40&amp;amp;searchIndex=3#75339"&gt;https://community.esri.com/message/75339?sr=search&amp;amp;searchId=c4e4a943-1567-4d2e-802c-abdaefd98d40&amp;amp;searchIndex=3#75339&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 20:57:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pythonaddins-gptooldialog-missing/m-p/735927#M57001</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-07-29T20:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: pythonaddins.GPToolDialog() Missing?</title>
      <link>https://community.esri.com/t5/python-questions/pythonaddins-gptooldialog-missing/m-p/735928#M57002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For some reason Shaun the messagebox displayed...&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"toolPath is set to '\GetIR.tbx' &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Should I see the joined path here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 21:09:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pythonaddins-gptooldialog-missing/m-p/735928#M57002</guid>
      <dc:creator>NoahHuntington</dc:creator>
      <dc:date>2014-07-29T21:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: pythonaddins.GPToolDialog() Missing?</title>
      <link>https://community.esri.com/t5/python-questions/pythonaddins-gptooldialog-missing/m-p/735929#M57003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan. Yeah that what I was working with. Still cant get past these results?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 21:10:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pythonaddins-gptooldialog-missing/m-p/735929#M57003</guid>
      <dc:creator>NoahHuntington</dc:creator>
      <dc:date>2014-07-29T21:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: pythonaddins.GPToolDialog() Missing?</title>
      <link>https://community.esri.com/t5/python-questions/pythonaddins-gptooldialog-missing/m-p/735930#M57004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This was completely my fault these were all great responses and correct answers for what I have provided here! It turns out I was confusing the script name for script label.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thus...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;pythonaddins.GPToolDialog(toolPath,"GetIRCount")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;instead of...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;pythonaddins.GPToolDialog(toolPath,"Get IR Count")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which is what is displayed in arc catalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you both for your time and valuable input!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 21:22:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pythonaddins-gptooldialog-missing/m-p/735930#M57004</guid>
      <dc:creator>NoahHuntington</dc:creator>
      <dc:date>2014-07-29T21:22:47Z</dc:date>
    </item>
  </channel>
</rss>

