<?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: Button in ArcGIS Pro with ArcPy? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/button-in-arcgis-pro-with-arcpy/m-p/1000641#M59023</link>
    <description>&lt;P&gt;You say you currently run your script from the command line this indicates you don't interact with the map, something that a tool button would allow. As&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1371"&gt;@JoshuaBixby&lt;/a&gt;&amp;nbsp; says the pythonaddin has not been ported to ArcPro. Why not run your script as a tool instead? You wire up your script to a &lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/geoprocessing_and_python/a-quick-tour-of-creating-tools-in-python.htm" target="_self"&gt;tool interface&lt;/A&gt; and then you can run it from a toolbox, it has the look, feel and behaviour of any other tool. This would provide an interface to your script to allow a user to change the input parameters.&lt;/P&gt;</description>
    <pubDate>Thu, 12 Nov 2020 13:17:10 GMT</pubDate>
    <dc:creator>DuncanHornby</dc:creator>
    <dc:date>2020-11-12T13:17:10Z</dc:date>
    <item>
      <title>Button in ArcGIS Pro with ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/button-in-arcgis-pro-with-arcpy/m-p/729593#M56579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it possible to create button in ArcGIS Pro with ArcPy?&amp;nbsp;I have a script that I run directly from the command line,&amp;nbsp;but I need to modify it to a button directly in ArcGIS Pro. I&amp;nbsp;know it can be achieved with SDK but is it possible with ArcPy?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2020 14:20:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/button-in-arcgis-pro-with-arcpy/m-p/729593#M56579</guid>
      <dc:creator>anyry</dc:creator>
      <dc:date>2020-11-05T14:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Button in ArcGIS Pro with ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/button-in-arcgis-pro-with-arcpy/m-p/729594#M56580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, &lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/latest/analyze/python-addins/the-pythonaddins-module.htm" title="https://desktop.arcgis.com/en/arcmap/latest/analyze/python-addins/the-pythonaddins-module.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;The pythonaddins module—ArcMap | Documentation&lt;/A&gt; has not, and likely won't be, ported over to ArcGIS Pro.&amp;nbsp; So, you are left looking to non-Esri/ArcGIS packages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are several options to present messages boxes, dialog boxes, etc... in Python:&amp;nbsp; tkinter, ctypes, pywin32, and others.&amp;nbsp; Normally I would suggest tkinter because it is cross-platform and the standard/default with Python, but Esri has done something under the hood to break standard tkinter syntax within ArcGIS Pro application.&amp;nbsp; I like ctypes, but it is a bit more involved for people who aren't used to working with it, so I suggest pywin32:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; win32ui
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; win32con

response &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; win32ui&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;"Message"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Title"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; win32con&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MB_YESNOCANCEL&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:09:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/button-in-arcgis-pro-with-arcpy/m-p/729594#M56580</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-12T07:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Button in ArcGIS Pro with ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/button-in-arcgis-pro-with-arcpy/m-p/729595#M56581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much for the tip, I will try it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2020 17:46:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/button-in-arcgis-pro-with-arcpy/m-p/729595#M56581</guid>
      <dc:creator>anyry</dc:creator>
      <dc:date>2020-11-05T17:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Button in ArcGIS Pro with ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/button-in-arcgis-pro-with-arcpy/m-p/1000641#M59023</link>
      <description>&lt;P&gt;You say you currently run your script from the command line this indicates you don't interact with the map, something that a tool button would allow. As&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1371"&gt;@JoshuaBixby&lt;/a&gt;&amp;nbsp; says the pythonaddin has not been ported to ArcPro. Why not run your script as a tool instead? You wire up your script to a &lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/geoprocessing_and_python/a-quick-tour-of-creating-tools-in-python.htm" target="_self"&gt;tool interface&lt;/A&gt; and then you can run it from a toolbox, it has the look, feel and behaviour of any other tool. This would provide an interface to your script to allow a user to change the input parameters.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 13:17:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/button-in-arcgis-pro-with-arcpy/m-p/1000641#M59023</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2020-11-12T13:17:10Z</dc:date>
    </item>
  </channel>
</rss>

