MyNewAddin_addin.somecombobox
somecombobox.value
import arcpy import pythonaddins class BufferTool(object): """Implementation for MultiBuffer_addin.tool (Tool)""" def __init__(self): self.enabled = True self.cursor = 3 def onMouseDownMap(self, x, y, button, shift): buffers= {"buffer1": [70, 1200], \ "buffer2": [110, 1700],\ "buffer3": [150, 1850]} sr = arcpy.SpatialReference(arcpy.Describe("parcels").spatialReference.factoryCode) pt = arcpy.PointGeometry(arcpy.Point(x,y), sr) arcpy.env.overwriteOutput = True arcpy.env.addOutputsToMap = True ptfeat = arcpy.management.CopyFeatures(pt, r"in_memory\pt") buff = "{0}".format(BufferType.value) print buff print buffers[buff] theBuffers = buffers[buff] #arcpy.MultipleRingBuffer_analysis(ptfeat, r'in_memory\blastzone', [200, 400]) # works arcpy.MultipleRingBuffer_analysis(ptfeat, r'in_memory\blastzone', theBuffers) arcpy.RefreshActiveView() class BufferType(object): """Implementation for MultiBuffer_addin.distance (ComboBox)""" def __init__(self): self.hintText = 'buffer type' self.items = ["buffer1", "buffer2", "buffer3"] self.editable = False self.enabled = True self.dropdownWidth = 'WWWWWWWWWW' self.width = 'WWWWWWWWWW' def onSelChange(self, selection): print self.value
Kevin, I see you still don't have any answers for this. Can you provide more information with your question? For example: the whole piece of code you are using, the error you are receiving... I am not familiar with any of the new features in 10.1, but in 10 you get values from inputs (including, I presume, comboboxes) via arcpy.GetValueAsText(). Or are you using something like Tk?
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.