I want to be able to enter a persons name into my combox so as to select it

348
2
08-26-2012 09:42 PM
OLANIYANOLAKUNLE
Occasional Contributor II
I want to be able to enter a persons name into my combox so as to select it within my active view, this is the code i use which only shows my layers within my data frame; i want to be able to key-in a particular attribute i.e name so as to select the feature with this attribute in my active view.

def onFocus(self, focused):

  # When the combo box has focus, update the combo box with the list of layer names.
 if focused:
  self.mxd = arcpy.mapping.MapDocument('current')
  layers = arcpy.mapping.ListLayers(self.mxd)
  self.items = []
               for layer in layers:
  self.items.append(layer.name)

Your suggestions would be highly appreciated. Thanks
Tags (2)
0 Kudos
2 Replies
JakeSkinner
Esri Esteemed Contributor
Are you trying to enter a value in the combo box, search through all the attribute tables within all the layers of your MXD, and then select the layer that contains the value within it's attribute table?
0 Kudos
OLANIYANOLAKUNLE
Occasional Contributor II
Thanks i got it.
0 Kudos