fc= "testABC.shp" var1= "D1_" + fc[4:7] #this gives you var1='D1_ABC' calcfield (var1) #now feed var1 to your function: # calculate PK_REL field in fc with newval def calcfield (val): newval = val * [AREA_K] / [AREA_I] gp.CalculateField_management(fc, "PK_REL" newval, "VB") gp.AddMessage("Successfully calculated field"+ '\n') return
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.