<?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: Interactive Python toolbox in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56408#M4470</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So if I use the messagebox it will halt the code till one presses 'continue' button and then it will keep running? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can a 'cancel' be added so it stops processing.. ah.. looks like &lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12.16px;"&gt;OK/Cancel is '1' and 3 is 'yes/no/cancel'. So I guess it does halt the code!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes I bet this will do just what I want. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Today is experiment day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks! Have a good 4th of July guys.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jun 2016 13:45:44 GMT</pubDate>
    <dc:creator>PaulHacker2</dc:creator>
    <dc:date>2016-06-28T13:45:44Z</dc:date>
    <item>
      <title>Interactive Python toolbox</title>
      <link>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56404#M4466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;I constructed a Python Toolbox that has many steps. When one first runs it a window comes up and for the layers and folders and shapes, the boxes for the information show up well.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;BUT, for each stage of the run I want it to display results and ask if one wants to continue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;Tkinter does NOT work for this (tried and tried.) And the &lt;SPAN class="n" style="color: #4d4d4d;"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="o" style="color: #4d4d4d;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n" style="color: #4d4d4d;"&gt;AddMessage does not seem to be suitable as it's a message and not being able to handle input like (Y/N) to continue.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN class="n" style="color: #4d4d4d;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;I would like the &lt;/SPAN&gt;&lt;SPAN style="font-size: 16px;"&gt;original&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt; box to say &lt;/SPAN&gt;&lt;SPAN style="font-size: 16px;"&gt;visible&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt; and the messages show up on the bottom.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN class="n" style="color: #4d4d4d;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN class="n" style="color: #4d4d4d;"&gt;Is this possible with ArcMAP/ArcGIS?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN class="n" style="color: #4d4d4d;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN class="n" style="color: #4d4d4d;"&gt;Thanks.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2016 18:45:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56404#M4466</guid>
      <dc:creator>PaulHacker2</dc:creator>
      <dc:date>2016-06-27T18:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Interactive Python toolbox</title>
      <link>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56405#M4467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tk definitely doesn't behave well with Arc*... and I wish there was a way to fix this.&amp;nbsp; Python or conventional toolboxes don't to the degree you want so I suspect it would be arcobjects or a rethink of your workflow.&amp;nbsp; Perhaps you could parse it into a couple of smaller tools, for instance, one to provide base information&amp;nbsp; before the workflow begins, then another to actually do the work.&amp;nbsp; The user could choose to just see the background and stop or continue on to the actual workflow or they could skip the background and just do the workflow.&amp;nbsp; This scenario may actually save the user time, particular for repetitive tasks using the same data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2016 19:02:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56405#M4467</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-06-27T19:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Interactive Python toolbox</title>
      <link>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56406#M4468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like I'll do that. The three steps become three tools on ONE Toolbox. At the end of each a message that will tell the user the step completed with or without errors and point to the next tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or... I could make a VisualStudio with Python or C# (but that would take quite a rewrite.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2016 19:24:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56406#M4468</guid>
      <dc:creator>PaulHacker2</dc:creator>
      <dc:date>2016-06-27T19:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Interactive Python toolbox</title>
      <link>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56407#M4469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you thought about using a python addin for your work flow?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import pythonaddins
pythonaddins.MessageBox('Continue', 'INFO', 3)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:08:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56407#M4469</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2021-12-10T22:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: Interactive Python toolbox</title>
      <link>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56408#M4470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So if I use the messagebox it will halt the code till one presses 'continue' button and then it will keep running? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can a 'cancel' be added so it stops processing.. ah.. looks like &lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12.16px;"&gt;OK/Cancel is '1' and 3 is 'yes/no/cancel'. So I guess it does halt the code!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes I bet this will do just what I want. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Today is experiment day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks! Have a good 4th of July guys.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2016 13:45:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56408#M4470</guid>
      <dc:creator>PaulHacker2</dc:creator>
      <dc:date>2016-06-28T13:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Interactive Python toolbox</title>
      <link>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56409#M4471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may want to try something similar to below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import pythonaddins,sys
val = pythonaddins.MessageBox('Continue', 'INFO', 1)
try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if val == 'Cancel':
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit()
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; pass&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:08:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56409#M4471</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2021-12-10T22:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Interactive Python toolbox</title>
      <link>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56410#M4472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note that the pythonaddins module is not intended to be used outside of addins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="pythonaddins.png" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/209801_pythonaddins.png" style="width: 620px; height: 408px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you by any chance familiar with ArcObjects? Also, if the tools are successful would there be a valid reason for the user to stop the execution of the next tool?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2016 20:00:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56410#M4472</guid>
      <dc:creator>FreddieGibson</dc:creator>
      <dc:date>2016-06-28T20:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Interactive Python toolbox</title>
      <link>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56411#M4473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works perfect. Thanks Guys!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2016 14:11:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56411#M4473</guid>
      <dc:creator>PaulHacker2</dc:creator>
      <dc:date>2016-06-29T14:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Interactive Python toolbox</title>
      <link>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56412#M4474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;In a nutshell,&amp;nbsp;putting &lt;STRONG style="border: 0px; font-weight: bold;"&gt;any&lt;/STRONG&gt; extra UI functionality into an ArcGIS tool is an antipattern, as the tools are designed to be portable within ArcGIS and usable from stand-alone Python.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;If you have a workflow which necessitates user input, this is a natural place to break the workflow up into multiple tools. Before the input step, write&amp;nbsp;your data and use that data as the input for the next tool, (Deciding to move forward is essentially the Yes/No dialog in your case).&amp;nbsp;This increases modularity of your tools and ensures that they can be accessed arbitrarily from any view - ArcGIS Desktop, Server or from a Python command line. Right now you'll get errors if you try to run outside of desktop and your tool is not portable between 10.x and Pro.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Breaking it up like that also&amp;nbsp;has the added benefit of future-proofing the workflow&amp;nbsp;- say somewhere down the line someone invents a process which removes the&amp;nbsp;need for user input, you can simply string your modularized workflow together in a 'wrapper' style tool, rather than recoding the entire&amp;nbsp;thing.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Hope that helps move things along!&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Clinton&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 23:36:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/interactive-python-toolbox/m-p/56412#M4474</guid>
      <dc:creator>ClintonDow1</dc:creator>
      <dc:date>2016-08-29T23:36:53Z</dc:date>
    </item>
  </channel>
</rss>

