Setting Python Toolbox Parameter to None without making current selection value unsel

المشرف العام

Administrator
طاقم الإدارة
I'm making a python toolbox and it has an input parameter of type GPFeatureLayer. Let's call it my_param.

In updateParameters when my_param.altered, its value is added to a value table. Then I'd like to set my_param.value = None, so that the selection is blanked out and same value could be immediately selected again.

As it stands right now, setting my_param.value = None means that that layer cannot be chosen again.

Why is this happening, and how can I achieve what I'm trying to do?

Here is some example code for you to use:

def getParameterInfo(self): my_param = Parameter(displayName='My Param', name='my_param', datatype='GPFeatureLayer', parameterType='Optional', direction='Input') return [my_param]def updateParameters(self, parameters): my_param = parameters[0] if my_param.altered: (function that appends my_param.value to another table, not important for this problem) my_param.value = None return

أكثر...
 
أعلى