@@ -0,0 +1,1578 @@
+## Author: Nick Ronnei (nronnei@gmail.com)%0A%0Aimport arcpy, sys%0A%0Adef FieldExists(featureclass, fieldname):%0A    fieldList = arcpy.ListFields(featureclass, fieldname)%0A%0A    fieldCount = len(fieldList)%0A%0A    if (fieldCount == 1):%0A        return True%0A    else:%0A        return False%0A%0A%0A## Declare variables%0Afc = r%22C:%5CGIS%5CCCVA%5CRisk.gdb%5CAQ_MajorRoadsRC%22%0Afields = %5B'RD_CHAR', 'BUFFER'%5D%0Arc_vals = %5B'RC10', 'RC20', 'RC30'%5D%0Abuf_vals = %5B'1600 Feet', '1300 Feet', '1000 Feet'%5D%0A%0A## Verify that the specified table extists (Verify Table Name = vtn)%0Avtn = arcpy.Exists(fc)%0Aif vtn:%0A    print %22FC validated... %5Cn%22%0Aelse:%0A    print %22Failed to locate the table, check the path.%22%0A    sys.exit()%0A%0A## Verify that the specified table extists (Verify Field Name = vfn)%0A## If it does not exist, add the field%0Avfn = FieldExists(fc, fields%5B1%5D)%0Aif vfn:%0A    print %22Field already exists...%5Cn%22%0Aelse:%0A    arcpy.AddField_management(fc, buf, 'Text')%0A    print %22Field created! %5Cn%22%0A%0A## Update the 'BUFFER' field with a value depending on %0A## the value of 'RD_CHAR'%0ArowCount = 0%0Awith arcpy.da.UpdateCursor(fc, fields) as cursor:%0A    for row in cursor:%0A        if row%5B0%5D == rc_vals%5B0%5D:%0A            row%5B1%5D = buf_vals%5B0%5D%0A        elif row%5B0%5D == rc_vals%5B1%5D:%0A            row%5B1%5D = buf_vals%5B1%5D%0A        elif row%5B0%5D == rc_vals%5B2%5D:%0A            row%5B1%5D = buf_vals%5B2%5D%0A        else:%0A            %22Something has gone horribly wrong! the value of RD_CHAR is %7B0%7D%22.format(row%5B0%5D)%0A        rowCount += 1%0A        cursor.updateRow(row)%0A        if rowCount %25 100 == 0:%0A            print str(rowCount) + ' rows counted...'%0A%0Aprint %22%5Cn%5Cn%5CnAll done!%22%0A

Add update_buffer_field