I have a python script that adds a hectares field and then calculates its
value using the Area field. This worked fine last week but for some
reason it gives null values this week.
code :
# final resultant
gp.Identity_analysis (interimFC, "THLB_Lyr", finalFC )
# Getting the name of the area field for our resultant
descObj = gp.Describe(finalFC)
areaField = descObj.AreaFieldName
print areaField, 'is the fieldname for Area'
# ADD a HECTARES COLUMN = 'AREA_HA'
gp.AddField_management(finalFC, "AREA_HA", "DOUBLE", "", "", "", "",
"NULLABLE", "NON_REQUIRED", "")
# CALCULATE AREA_HA using AREA FIELD
print 'calculating Hectares field'
hectaresCalc = '"' + '[' + areaField + ']/10000' + '"'
print hectaresCalc
gp.CalculateField_management(finalFC, "AREA_HA", hectaresCalc, "VB",
"")
I got that syntax from the ArcToolbox. I don't know why it suddenly
stopped working. I swear this worked last week. Now I get a resultant
dataset that has AREA_HA added but it's values are all null.
Any suggestions or ideas?