Is it possible, in a python toolbox, to define a parameter (arcpy.Parameter()) in def updateParameters() or somehow define parameters so that both number (of parameters) and values (in parameter) is dependent on user input in first parameter?
Thanks for reaching out.
I tried defining all paramters "statically" in def getParameterInfo, but setting enabled=False to the ones i do not want to show up. Then in def updateParameters i tried to set enabled = True, and displayName = 'New_name' (displayName will be dependent on the data the user chooses). Only setting enabled = True works. Trying to change displayName in this way gives an AttributeError. Being able to change displayName would help avoid defining a lot of different parameters in getParameterInfo i think.
Something like this in updateParameters:
if parameters[2].valueAsText: parameters[3].enabled = True parameters[3].displayName = 'New_name'
Obviously not the way to do it. Not sure I understand how to use 'altered' in this case. Any pointers?
Not sure about the number of parameters but parameter values can be changed using 'altered'
Customizing tool behavior in a Python toolbox—Geoprocessing and Python | ArcGIS Desktop
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.