AnsweredAssumed Answered

Is wxPython incompatible with ArcMap add-ins and tools?

Question asked by jdmorganesri on May 4, 2018
Latest reply on May 9, 2018 by curtvprice

I have written an Add-In that generates a dialog box that allows the user to select Census Bureau TIGER/Line data layers by description (year, state, state-wide or county layer, layer type) instead of using the standardized file naming convention (which has changed often over the years.)  I previously wrote a version of this tool as an ArcMap Add-In in VB.NET using Visual Studio, but unfortunately, each version of ArcGIS is tied to a particular version of Visual Studio.  I was able to successfully compile the VB.NET Add-In in Visual Studio 2008 (supported by ArcGIS 10.0).  The finished Add-In continues to work in ArcGIS 10.4, but the same source code no longer compiles in Visual Studio 2013 (supported by ArcGIS 10.4), so it is impossible to make any modifications to the Add-In. 


I decided to try rewriting it in Python, since ESRI is pushing Python as the new development language for customizing ArcGIS.


I have written a script in Python that uses the wxPython package to build the dialog box and GUI controls, and it works fine when I run it from the Python command line window inside ArcMap.  Unfortunately, when I try to incorporate it into a Toolbox tool, it crashes ArcMap when I try to run it, and when I try to make it into an ArcMap Add-in button, it runs exactly once.  The second time I try to run it as an Add-In button, it crashes ArcMap.


Is wxPython incompatible with the Toolbox tool and the ArcMap Add-In implementations?  I assume that both of these involve putting some kind of wrapper around the Python script