First, I really appreciate your help!I too don't get a crash with the int code. But my results indicated that the wrong coordinate system was being used. Although, I know that is not the case after printing the name of the spatial reference as you suggested. Seems my problem is elsewhere.The rest of my code simply adds a field and then calculates the length of each shape. Unfortunately the numbers I am getting are really small. E.g. I get 0.00000033935 for a shape that I measure to be 0.03384 miles (or 0.00000312066 for 0.296182 miles). Not sure what unit that is in, but most of my shapes (roads) should be about a mile long. This number makes me think it is in hemispheres! They seem to be about 100,000 miles. Oddly, if I run my code without the int and for only one record... it works!
if (arcpy.Exists(myPath + "\\TigerFiles\\" + InputRoadShpfl)) and arcpy.Exists(myPath + "\\TigerFiles\\" + InputBoundaryShpfl):
print "Executing shapefiles:" + InputBoundaryShpfl + " & " + InputRoadShpfl + "(" + StateName + "\\" + CountyName + ")"
# Make a layer from the feature class
#arcpy.MakeFeatureLayer_management(myPath + "\\TigerFiles\\" + InputRoadShpfl, tmpRoads)
arcpy.CopyFeatures_management(myPath + "\\TigerFiles\\" + InputRoadShpfl, tmpRoads)
arcpy.MakeFeatureLayer_management(myPath + "\\TigerFiles\\" + InputBoundaryShpfl, tmpBoundaries)
# Process: Define Projection (3)
#sr = arcpy.SpatialReference(102629)
print ProjCode
sr = arcpy.SpatialReference(ProjCode)
#sr = arcpy.SpatialReference(ProjName)
#sr.factoryCode = ProjCode
sr.create()
print sr.name
arcpy.DefineProjection_management(tmpRoads, sr)
# Process: Add Field
arcpy.AddField_management(tmpRoads, "Length", "DOUBLE", "6", "3", "", "", "NULLABLE", "NON_REQUIRED", "")
# Process: Calculate Field
arcpy.CalculateField_management(tmpRoads, "Length", "!shape.length@miles!", "PYTHON", "")
# Process: Define Projection (2)
arcpy.DefineProjection_management(tmpRoads, "GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]")