import arcpy, os from arcpy import env env.workspace = r"C:\temp\python\test.gdb" env.overwriteOutput = True # Add Distance field if it does not exist lstFields = arcpy.ListFields("Table_1") for field in lstFields: if field.name == "Distance": "" else: arcpy.AddField_management("Table_1", "Distance", "Double") # Join tables arcpy.MakeTableView_management("Table_1", "Table_1_View") arcpy.AddJoin_management("Table_1_View", "Name_ID", "Table_2", "Name_ID") arcpy.AddJoin_management("Table_1_View", "Table_1.Name_ID", "Table_3", "Name_ID") # Update Distance field arcpy.CalculateField_management("Table_1_View", "Table_1.Distance", "!Table_2.Distance! + !Table_3.Distance!" , "PYTHON") print "Successful"
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.