Hello everyone,
I am using arcpy.management.AddGeometryAttributes to add 2 fields to feature classes (Acres and Hectares). I have to run the code twice, once for acres and once for hectares. I'm not sure if I'm reading the documentation incorrectly, but it kind of reads like I could have it create the acres and hectares fields by just running the code once.
My confusion is in acres/hectares are specified in the Area_Unit parameter and if it's possible to pass in multiple strings to that parameter (i.e. "Acres; Hectares") to have it create multiple fields in one go.
Anybody know if this is possible, or if I'm just hoping it will do something it won't.
Thanks!
Add Geometry Attributes (Data Management)—ArcGIS Pro | Documentation
Solved! Go to Solution.
You can create a Python script for the following.
Please Add fields for Area_Ac and Area_Ha as Float or Double (if not already created).
Then use Calculate Field for each field using the following expressions, as required
Expression 1 (Area_Ac):
!shape.area@acres!
Expression 2 (Area_Ha):
!shape.area@hectares!
You can create a Python script for the following.
Please Add fields for Area_Ac and Area_Ha as Float or Double (if not already created).
Then use Calculate Field for each field using the following expressions, as required
Expression 1 (Area_Ac):
!shape.area@acres!
Expression 2 (Area_Ha):
!shape.area@hectares!
Thanks Jayanta. Your suggestion works perfect!