AnsweredAssumed Answered

Using Validator Class to Update Value List Parameter

Question asked by BrokenLegMike on Mar 31, 2014
Latest reply on Apr 1, 2014 by BrokenLegMike
With the validator class in the arcpy GUI, we can update a value list using the filter.list property:

fc = "path to fc" vList = [str(i.getValue("SITE_NAME")) for i in arcpy.SearchCursor(fc)] self.params[2].filter.list = vList


This will update a list of SITE NAMES from the fc upon GUI initiation (using a string parameter type). When the tool appears, as expected, the list is populated with the ability to toogle on and off each item in the list with a check mark. The list populates with all items as 'unchecked' by default. Is there a way to update the validator class to populate the list with all the items 'checked'?

I played around with setting the values to True:

self.params[2].filter.enabled = True


self.params[2].Value = True


I've gone through the lsit of parameters method and properties and I don't see a property that allows me to set the list values to true:

http://resources.arcgis.com/en/help/main/10.1/index.html#//00150000002m000000

http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000006000000

Outcomes