Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(8)  |  Derive(0)  |  Import(0)

src/d/e/defense-and-intel-analysis-toolbox-HEAD/toolboxes/scripts/FM5-33CCM.py   defense-and-intel-analysis-toolbox(Download)
    arcpy.RasterToPolygon_conversion(boundaryClean,slopePoly,"NO_SIMPLIFY","VALUE")
    arcpy.AddField_management(slopePoly,"SlopeCat","SHORT")
    arcpy.CalculateField_management(slopePoly,"SlopeCat","!grid_code!","PYTHON_9.3")
    arcpy.DeleteField_management(slopePoly,"grid_code")
 
    if debug == True: arcpy.AddMessage(str(time.strftime("Calculate F1: %m/%d/%Y  %H:%M:%S", time.localtime())))
    block = "slopeMedians = {1:1.5,2:6.5,3:15.0,4:25.0,5:37.5,6:45.0}\ndef CalcF1(slope_cat):\n   f1 = float((" + str(vehicleParams[5]) + " - slopeMedians[slope_cat]) / (" + str(vehicleParams[4]) + " / " + str(vehicleParams[3]) + "))\n   return f1"
    arcpy.CalculateField_management(slopePoly,"f1",expression,"PYTHON_9.3",block)    
    deleteme.append(slopePoly)
    intersectionList.append(slopePoly)
        arcpy.CreateFeatureclass_management(os.path.dirname(tileClip),os.path.basename(tileClip),"POLYGON","#","#","#",srAOI)
        arcpy.AddField_management(tileClip,"FnetID","LONG")
        arcpy.CalculateField_management(tileClip,"FnetID",tileOID)
        deleteme.append(tileClip)
        rs = arcpy.da.InsertCursor(tileClip,["SHAPE@"])
        # SIF count with adjustment for 100m contour intervals
        codeblock = "import types\ndef calcSIF(meancount):\n   if meancount == types.NoneType: meancount = 0.0\n   SIF = (280.0 - float((meancount * 100.0)/20.0))/280.0\n   return SIF"
        arcpy.CalculateField_management(stats2,"f2",r"calcSIF(!MEAN_COUNT_ID!)","PYTHON_9.3",codeblock)
 
        # join intercept stats table to slope polys

src/d/e/defense-and-intel-analysis-toolbox-HEAD/toolboxes/scripts/Trajectory_Path.py   defense-and-intel-analysis-toolbox(Download)
    arcpy.sa.ExtractValuesToPoints(inputFeature,inputSurface,extractPoints,"NONE","VALUE_ONLY")
    arcpy.AddField_management(extractPoints,"Z","DOUBLE")
    arcpy.CalculateField_management(extractPoints,"Z","!RASTERVALU!","PYTHON_9.3")
 
    # make dictionary from observer XYs and project to Web Merc

src/a/r/arcapi-HEAD/arcapi.py   arcapi(Download)
        if alias == "": alias = newcol
        arcpy.AddField_management(tbl, newcol, oldF.type, oldF.precision, oldF.scale, oldF.length, alias, oldF.isNullable, oldF.required, oldF.domain)
        arcpy.CalculateField_management(tbl, newcol, "!" + col + "!", "PYTHON_9.3")
        arcpy.DeleteField_management(tbl, col)
    return newcol

src/d/e/defense-and-intel-analysis-toolbox-HEAD/toolboxes/scripts/LLOSProfileGraphAttachments.py   defense-and-intel-analysis-toolbox(Download)
    arcpy.AddField_management(inputFeatures,"pngname","TEXT")
    expression = '"profile" + str(!SourceOID!)'
    arcpy.CalculateField_management(inputFeatures,"pngname",expression, "PYTHON")
 
    # get visible and non-visible lines for each LLOS

src/a/r/arcpy-HEAD/add-filename-field.py   arcpy(Download)
 
	# Process: Calculate Field
	arcpy.CalculateField_management("shapefiles/" + feature_class, "filename", "feature_class[:-4]" , "PYTHON", "")
 
	count += 1