@DanPatterson
I know this post is from over a year ago, but it is the only one that is similar to what I am dealing with currently in a model that I have built for calculating geometry attributes in an acreage field for our parcel polygons. I have another post out there where a gentleman is trying to assist me, but he isn't clarifying on how or where to effectively round the decimal to 2 in my model script. Could you possibly assist me with this Dan? Any help you can offer will be GREATLY appreciated! See the model script in the python window below.
# -*- coding: utf-8 -*-
"""
Generated by ArcGIS ModelBuilder on : 2021-09-30 10:58:27
"""
import arcpy
def GeometryCalc(): # GeometryCalc
# To allow overwriting outputs change overwriteOutput option to True.
arcpy.env.overwriteOutput = False
arcpy.ImportToolbox(r"c:\program files\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx")
# Model Environment settings
with arcpy.EnvManager(scratchWorkspace=r"C:\Users\abishop\AppData\Local\Temp\ArcGISProTemp10544\1ba0f558-c873-4c6c-be6d-dc08393016c0\Default.gdb", workspace=r"C:\Users\abishop\AppData\Local\Temp\ArcGISProTemp10544\1ba0f558-c873-4c6c-be6d-dc08393016c0\Default.gdb"):
mcpagis_DBO_Parcels = "K:\\GIS_TOOLS\\DB\\merlin.sde\\mcpagis.DBO.Cadastre__Features\\mcpagis.DBO.Parcels"
# Process: Make Feature Layer (Make Feature Layer) (management)
DBO_Parcels_Layer = "DBO.Parcels_Layer"
with arcpy.EnvManager(scratchWorkspace=r"C:\Users\abishop\AppData\Local\Temp\ArcGISProTemp8392\0686a1b7-5a62-4965-97f7-463b179295c6\Default.gdb", workspace=r"C:\Users\abishop\AppData\Local\Temp\ArcGISProTemp8392\0686a1b7-5a62-4965-97f7-463b179295c6\Default.gdb"):
arcpy.management.MakeFeatureLayer(in_features=mcpagis_DBO_Parcels, out_layer=DBO_Parcels_Layer, where_clause="GIS_ACRES = 0 Or GIS_ACRES IS NULL", workspace="", field_info="OBJECTID OBJECTID VISIBLE NONE;PARCEL PARCEL VISIBLE NONE;PREFIX PREFIX VISIBLE NONE;SUFFIX1 SUFFIX1 VISIBLE NONE;SUFFIX2 SUFFIX2 VISIBLE NONE;GIS_ACRES GIS_ACRES VISIBLE NONE;KIND KIND VISIBLE NONE;ANGLE ANGLE VISIBLE NONE;SIZE_ SIZE_ VISIBLE NONE;DATE_CREATED DATE_CREATED VISIBLE NONE;DATE_UPDATED DATE_UPDATED VISIBLE NONE;SHAPE SHAPE VISIBLE NONE;SHAPE.area SHAPE.area VISIBLE NONE;SHAPE.len SHAPE.len VISIBLE NONE")
# Process: Calculate Geometry Attributes (Calculate Geometry Attributes) (management)
with arcpy.EnvManager(scratchWorkspace=r"C:\Users\abishop\AppData\Local\Temp\ArcGISProTemp8392\0686a1b7-5a62-4965-97f7-463b179295c6\Default.gdb", workspace=r"C:\Users\abishop\AppData\Local\Temp\ArcGISProTemp8392\0686a1b7-5a62-4965-97f7-463b179295c6\Default.gdb"):
DBO_Parcels_Layer_2_ = arcpy.management.CalculateGeometryAttributes(in_features=DBO_Parcels_Layer, geometry_property=[["GIS_ACRES", "AREA"]], length_unit="", area_unit="ACRES", coordinate_system="PROJCS[\"NAD_1983_StatePlane_Florida_West_FIPS_0902_Feet\",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]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",656166.6666666665],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-82.0],PARAMETER[\"Scale_Factor\",0.9999411764705882],PARAMETER[\"Latitude_Of_Origin\",24.33333333333333],UNIT[\"Foot_US\",0.3048006096012192]]", coordinate_format="SAME_AS_INPUT")[0]
if __name__ == '__main__':
GeometryCalc()
Amanda Bishop, GISP