New answers tagged python-addin
Since you're using a python addin, you could use the pythonaddins.OpenDialog method. Slightly modified example based on the documentation: This add-in button uses OpenDialog() to select a set of layer files and adds each layer to the selected data frame. import arcpy import pythonaddins class AddLayers(object): def __init__(self): ...
I found a technique to do this described at Another GIS Blog under the title of Python Add-Ins and Tkinter: ArcGIS for Desktop does not support any python GUIs out of the box, but let's say we want to have a form pop-up anyway. ... One way to do this is to create a wx python instance at start up, which is create before the desktop python loop is ...
There is no property that defines the number of items that can be shown in the ComboBox. Instead, use the onFocus method to append the layers in the TOC to the drop-down list. def onFocus(self, focused): # When focused, update the combo box with the list of layer names. if focused: self.mxd = arcpy.mapping.MapDocument('current') ...
I was stupid and did not read the instructions correctly. I thought I had a version problem because the documentation was listed for ArcGIS 10.1 and the tutorial images did not match expectations (items were missing from the wizard). Turns out I just had to right-click to be presented with the "missing" options.
Top 50 recent answers are included