I did just this for a tool last week - I'm at 10.0 and used the ToolValidator, simple changing (or adding) 3 lines:class ToolValidator: """Class for validating a tool's parameter values and controlling the behavior of the tool's dialog.""" def __init__(self): """Setup arcpy and the list of tool parameters.""" import arcpy self.params = arcpy.GetParameterInfo() def initializeParameters(self): """Refine the properties of a tool's parameters. This method is called when the tool is opened.""" self.params[0].filter.list = ['val1', 'val2', 'val3', 'val4'] return def updateParameters(self): """Modify the values and properties of parameters before internal validation is performed. This method is called whenever a parmater has been changed.""" if not self.params[0].altered: self.params[0].value = r"'val1';'val2';'val3'" return def updateMessages(self): """Modify the messages created by internal validation for each tool parameter. This method is called after internal validation.""" return
The line "self.params[0].filter.list = ['val1', 'val2', 'val3', 'val4']" sets my value list (in this case, for the 1st input parameter ([0]), a multivalue param.The 2-line block sets up the default 3 vals checked on by default - if what is checkmarked by default is 'altered', then that defines the new input:if not self.params[0].altered: self.params[0].value = r"'val1';'val2';'val3'"
As a result, on execution vals 1-3 are on and are fetched correctly at GetParameterAsText and if val4 is checked on, then GetParameterAsText fetches the additional val4. (or if any other combination is chosen, the input is adjusted accordingly) Perfect!Enjoy,Wayne