mercredi 30 novembre 2016

How to change a parameter to false after the first time in python?

I'm working with python scripting in ArcGIS software. I have a problem with setting a parameter to false when it's true. The parameters[5] has a read only property "altered". When the code at the first time executed the first condition runs because the parameters[5] is not altered at the first time.But at the other times the parameter has been altered and the if condition not working. How to change the the parameter to false after the first execute of code ?

vtab = []
if parameters[4].altered and not parameters[5].altered:
                  with arcpy.da.SearchCursor(parameters[2].value,["Code1","Code2","Code3"],where_clause = sqlfinal) as curtable:                   
                    for rowt in curtable:
                       vtab.append([rowt[0],rowt[1],rowt[2]])
                       parameters[5].value = vtab

Aucun commentaire:

Enregistrer un commentaire