AnsweredAssumed Answered

PyQt to Interact with the map

Question asked by newjim on Sep 16, 2015

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.

 

I also have a script tool that when invoked adds a layer to the map.

 

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:

 

mxd = arcpy.mapping.MapDocument("CURRENT")

# etc

 

...but nothing happens.

 

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.

 

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?

 

Thanks

Outcomes