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
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.