AnsweredAssumed Answered

How can you sort a set of unique values? Arcpy addin

Question asked by jdgraham on Mar 13, 2014
Latest reply on Mar 13, 2014 by jdgraham
I have tried many ways to sort that work, but then I can't get unique values.  The following works to return unique values, it would seem I need to add something to the onFocus part to make it work.  any suggestions?
Rng = [] for row in arcpy.SearchCursor("X:\JasonGraham\Landstatus\Data\ls2014.gdb\BaseData\Townships"):     Rng.append(row.RNG_NUMC)      class ComboBoxClass7(object): #Collect Range from list of unique values gathered from the layer     """Implementation for MTR_addin.combobox_3 (ComboBox)"""     def __init__(self):         self.value = "000"         self.items = (Rng)         self.editable = True         self.enabled = True         self.dropdownWidth = 'WWWW'         self.width = 'WWWW'     def onSelChange(self, selection):         self.sel = selection        def onEditChange(self, text):         pass     def onFocus(self, focused):#show only unique values         if focused:             values = (Rng)             uniqueValues = set(values)             self.items = []             for uniqueValue in uniqueValues:                 self.items.append(uniqueValue)