import arcpy # don't import modules if you're not gonna use them sys, string, os # Get the input from the model InputTable = arcpy.GetParameterAsText(0) InputArea = arcpy.GetParameterAsText(1) InputDepth = arcpy.GetParameterAsText(2) Newfield = "Volume" #Add Field arcpy.AddField_management(InputTable, Newfield, "DOUBLE", "", "","", "Vol","NON_NULLABLE","NON_REQUIRED","") #Calculate Field # field names should be wrapped in exclamation marks, function uses string #representation of expression, not real python expression Expression = '!%s! * !%s!' % (InputArea.upper(), InputDepth.upper()) # 'PYTHON' not 'Python' arcpy.CalculateField_management(InputTable, Newfield, Expression, "PYTHON")
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.