It looks like a scope problem.try setting each parameter to a variable using GetParameterAsText outside the expression string, and use the variables inside the string. As it stands, you are referenceing a property of the gp inside a tool running in the gp (the gp.GetParameterAsText(n) is not evaluated until it has already been passed as an expression parameter to CalculateField).to wit:param2 = gp.GetParameterAsText(2) param3 = gp.GetParameterAsText(3) expression = "autoIncrement(param2, param3)"
param2 = gp.GetParameterAsText(2) param3 = gp.GetParameterAsText(3) expression = "autoIncrement(param2, param3)"
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.