AnsweredAssumed Answered

How to link to list parameters in and ArctoolBox?

Question asked by akifsaid on Jul 2, 2015
Latest reply on Jul 3, 2015 by akifsaid



Among other parameters in an ArcToolBox i developed, two string parameters. each one is filtred by a Value List.

lets say the first list is related to five Canada regions: ATL, PNR, PYR, QC and ON. each of those regions is composed of proinces and territories: ATL = NB, NL, NS, PE; ON=ON, QC=QC; PNR = AB, MB, NT, NU, SK and PYR=BC, YT. the Regions parameters is regions=arcpy.GetParameterAsText(4) and the provinces/terretories parameter is  ProvTerri = arcpy.GetParameterAsText(5).

Now what I want is to automatically populate ProvTerri when I select one of the regions. I wrote the following code in validation, but it did not work:


def updateParameters(self):

   if (self.params[4].value and not self.params[5].hasbeenvalidated):

      if self.params[4].value=["PNR"]:

         self.params[5].filter.list = ["AB","MB","NT","NU","SK"]

      if .....

      if not self.params[4].value:



I also try to figure out the problem assuming that the problem come from the assessmenet of self.params[4].value. since it is a liste, I put after the first if:



  if names1 = "PNR":



Thanks for your help