I'm working on a ToolValidation Code (Python) and want to pass a result (values) from the function "updateParameters" to the function "updateMessages". Does anybody has good example how to do that?
Just off the top of my head, you could do something like the following using a python toolbox:
class SomeTool(object): def __init__(self): self.some_variable = None #etc... def getParameterInfo(self): #etc... return params def updateParameters(self, parameters): result = arcpy.ATool_SomeToolbox('somedata') self.some_variable = result.GetOutput(0) def updateMessages(self, parameters): if self.some_variable is not None: #Do something #etc... self.some_variable = None #reset the variable just in case
Thanks for your idea, but I did not succeed with it. I made now an ugly workaround, but it works for the moment.