<?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: User Input @ Python Add-in in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231854#M17981</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need something that will&amp;nbsp;function on a tool OnRectangle event, feature attributes will then be looped to get unique values, for the user to make a selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That was just a simple example for brevity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think your toolbox show method should work for this!, one day I will try it out. (Hopefully I can pass something to the toolbox interface to populate data from my selected features!)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Sep 2016 12:14:19 GMT</pubDate>
    <dc:creator>LukeWebb</dc:creator>
    <dc:date>2016-09-16T12:14:19Z</dc:date>
    <item>
      <title>User Input @ Python Add-in</title>
      <link>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231844#M17971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;While searching for how to get any user parameter @ add-in, &amp;nbsp;i found tkinter but before move forward with tkinter i'd like to ask if is there any other easy way to get user input. Just i want to get text from user and at layout i've text element and add-in button 'll only change element 's text property according to value comes from user. Only issue some kind of gui is needed to show user and get the text &amp;nbsp;expected. Any walkthrough or sample would be helpful.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2016 08:13:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231844#M17971</guid>
      <dc:creator>Yusuf_CelilKonak</dc:creator>
      <dc:date>2016-08-26T08:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: User Input @ Python Add-in</title>
      <link>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231845#M17972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;tkinter doesn't behave well with ArcMap... there are threads on this issue but they are old, since most people have given up on trying it long ago. To satisfy you curiousity, have a try... maybe you can live the threads with a new report&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2016 10:43:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231845#M17972</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-08-26T10:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: User Input @ Python Add-in</title>
      <link>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231846#M17973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As you mention, threads old and there is not much clue,&amp;nbsp;i'll try but it seems only way ArcObjects for this type issues.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2016 14:24:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231846#M17973</guid>
      <dc:creator>Yusuf_CelilKonak</dc:creator>
      <dc:date>2016-08-26T14:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: User Input @ Python Add-in</title>
      <link>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231847#M17974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/python-addins/the-pythonaddins-module.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;SPAN&gt;pythonaddins.GPToolDialog&lt;/SPAN&gt;&lt;/A&gt; to get user input from an addin toolbar. The code that does the work with the user input is contained in the tool that is called by GPToolDialog, rather than in the addin.&amp;nbsp; I package the toolbox and tool inside the addin, in the addin install directory (I use a pyt instead of tbx and py so it's in a single file).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;class&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Button&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;object&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;"""Implementation for test_addin.button (Button)"""&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;__init__&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;self&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;enabled &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;checked &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;onClick&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;self&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tbx &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dirname&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;__file__&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Toolbox.pyt"&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tool &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Tool"&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pythonaddins&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GPToolDialog&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tbx&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; tool&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&amp;nbsp; ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:44:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231847#M17974</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2021-12-11T11:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: User Input @ Python Add-in</title>
      <link>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231848#M17975</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;SPAN style="border: 0px; font-weight: bold;"&gt;&lt;STRONG&gt;any&lt;/STRONG&gt;&lt;/SPAN&gt; extra UI functionality into an ArcGIS tool or add-in is an antipattern, as the tools are designed to be portable within ArcGIS.&amp;nbsp;&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 tasks. Before the step which would require the user input, write&amp;nbsp;your data and use that data as the input for the next tool/add-in, plus whatever input the user would have supplied.&amp;nbsp;This increases modularity of your tools and ensures that they can be accessed arbitrarily from any view.&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;This 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 add-in, 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;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;edit: for clarity&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 23:22:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231848#M17975</guid>
      <dc:creator>ClintonDow1</dc:creator>
      <dc:date>2016-08-29T23:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: User Input @ Python Add-in</title>
      <link>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231849#M17976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Clinton, I agree, however... this particular topic is about addins, not tools so by definition will always have some sort of UI.&amp;nbsp; I think using a tool dialog to gather input actually makes it more modular and portable as the script tool can be reused/ported/run as is without needing to rip it out of add-in UI code.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2016 02:20:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231849#M17976</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2016-08-30T02:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: User Input @ Python Add-in</title>
      <link>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231850#M17977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Best solution is the easy solution. Calling scripts was the idea and this is very handy way to do that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Luke.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2016 11:37:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231850#M17977</guid>
      <dc:creator>Yusuf_CelilKonak</dc:creator>
      <dc:date>2016-08-30T11:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: User Input @ Python Add-in</title>
      <link>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231851#M17978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have not tried implementing this just yet, but my current plan for some advanced user input is to create a "&lt;SPAN style="color: #4d4d4d; background-color: #ffffff; font-weight: bold;"&gt;OpenDialog"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;And programatically place some files in a folder and make it open in this location. (e.g &amp;nbsp; &amp;nbsp;Yes.txt, No.Txt, Other.txt) and let the user select a file from here.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;Maybe this would work (and they could rename the file before selecting?)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;I think Luke Pinners solution is probably better and the correct way to do it!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2016 11:51:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231851#M17978</guid>
      <dc:creator>LukeWebb</dc:creator>
      <dc:date>2016-08-30T11:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: User Input @ Python Add-in</title>
      <link>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231852#M17979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Luke, you're correct -&amp;nbsp;add-ins will require the UI element while in contrast&amp;nbsp;you could run a script tool stand-alone and use command-line args in place of the tool dialog. Im mostly trying to stress that if the task the add-in (or tool) accomplishes requires run-time input it's best broken up into multiple steps. If coded modularly your add-in/tool/console&amp;nbsp;application should simply import a module containing the logic anyways and keep as much code&amp;nbsp;out of the 'view' as possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2016 17:48:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231852#M17979</guid>
      <dc:creator>ClintonDow1</dc:creator>
      <dc:date>2016-08-30T17:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: User Input @ Python Add-in</title>
      <link>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231853#M17980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry to be blunt, but that sounds like a very ugly and fragile way of doing it. If you just want Yes/No/Other, use a &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/python-addins/the-pythonaddins-module.htm"&gt;&lt;SPAN class=""&gt;MessageBox.&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;i.e&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pythonaddins&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MessageBox&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Press Yes, No or Cancel"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Just do it!"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2016 23:33:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231853#M17980</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2016-08-30T23:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: User Input @ Python Add-in</title>
      <link>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231854#M17981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need something that will&amp;nbsp;function on a tool OnRectangle event, feature attributes will then be looped to get unique values, for the user to make a selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That was just a simple example for brevity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think your toolbox show method should work for this!, one day I will try it out. (Hopefully I can pass something to the toolbox interface to populate data from my selected features!)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2016 12:14:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231854#M17981</guid>
      <dc:creator>LukeWebb</dc:creator>
      <dc:date>2016-09-16T12:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: User Input @ Python Add-in</title>
      <link>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231855#M17982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you put the toolbox under a secondary directory such as ..\Install\Toolbox\, you will&amp;nbsp;need to make sure that Toolbox directory is included like so:&lt;/P&gt;&lt;P&gt;pytoolbx = os.path.join(os.path.dirname(__file__), "Toolbox\Toolbox.pyt")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 10:46:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/user-input-python-add-in/m-p/231855#M17982</guid>
      <dc:creator>EricAnderson</dc:creator>
      <dc:date>2016-10-27T10:46:26Z</dc:date>
    </item>
  </channel>
</rss>

