<?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 PyQt to Interact with the map in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/pyqt-to-interact-with-the-map/m-p/726811#M56378</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a PyQT GUI and can invoke it in ArcMap via a script tool. It can do the usual things that you expect from a GUI, for example, on the click of a button it populates a combo box from a database lookup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also have a script tool that when invoked adds a layer to the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I try to combine these two scripts, the GUI does nothing. For example, when I click the button, instead of populating the combo box I have coded:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mxd = arcpy.mapping.MapDocument("CURRENT")&lt;/P&gt;&lt;P&gt;# etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...but nothing happens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It think that part of the problem is that for the GUI I have to uncheck "Always run in foreground" but for the other script I have to check that box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my question is, is it possible for a Python script to interact with the map when it is in a script that invokes a GUI using PyQt?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Sep 2015 14:30:32 GMT</pubDate>
    <dc:creator>JimO_Leary1</dc:creator>
    <dc:date>2015-09-16T14:30:32Z</dc:date>
    <item>
      <title>PyQt to Interact with the map</title>
      <link>https://community.esri.com/t5/python-questions/pyqt-to-interact-with-the-map/m-p/726811#M56378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a PyQT GUI and can invoke it in ArcMap via a script tool. It can do the usual things that you expect from a GUI, for example, on the click of a button it populates a combo box from a database lookup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also have a script tool that when invoked adds a layer to the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I try to combine these two scripts, the GUI does nothing. For example, when I click the button, instead of populating the combo box I have coded:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mxd = arcpy.mapping.MapDocument("CURRENT")&lt;/P&gt;&lt;P&gt;# etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...but nothing happens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It think that part of the problem is that for the GUI I have to uncheck "Always run in foreground" but for the other script I have to check that box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my question is, is it possible for a Python script to interact with the map when it is in a script that invokes a GUI using PyQt?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2015 14:30:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyqt-to-interact-with-the-map/m-p/726811#M56378</guid>
      <dc:creator>JimO_Leary1</dc:creator>
      <dc:date>2015-09-16T14:30:32Z</dc:date>
    </item>
  </channel>
</rss>

