<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Acreage Script in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/acreage-script/m-p/684305#M52983</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am currently building a model in model builder and I need to add a Python Script (unless someone know of Toolbox tool) that will add acreage to the attribute table. Does anyone have a script handy or know of somewhere I could find one for acreage?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Dec 2013 14:50:16 GMT</pubDate>
    <dc:creator>Lebowski</dc:creator>
    <dc:date>2013-12-06T14:50:16Z</dc:date>
    <item>
      <title>Acreage Script</title>
      <link>https://community.esri.com/t5/python-questions/acreage-script/m-p/684305#M52983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am currently building a model in model builder and I need to add a Python Script (unless someone know of Toolbox tool) that will add acreage to the attribute table. Does anyone have a script handy or know of somewhere I could find one for acreage?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2013 14:50:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/acreage-script/m-p/684305#M52983</guid>
      <dc:creator>Lebowski</dc:creator>
      <dc:date>2013-12-06T14:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Acreage Script</title>
      <link>https://community.esri.com/t5/python-questions/acreage-script/m-p/684306#M52984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, you've probably got it by now, but you can enter either the system Calculate Field tool directly, or add a script tool if that's what you prefer in your custom model...either way, you can access acreage by token with this python expression:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;!shape.area@acres!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's documented in many different places - this is probably your best bet:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using the Calculate Field tool&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Geodata » Data types » Tables&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//005s00000029000000"&gt;http://resources.arcgis.com/en/help/main/10.2/index.html#//005s00000029000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2013 18:00:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/acreage-script/m-p/684306#M52984</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2013-12-06T18:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Acreage Script</title>
      <link>https://community.esri.com/t5/python-questions/acreage-script/m-p/684307#M52985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is one i use. The down side using python is that you have to indicate which layer you want add acreage to. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
from arcpy import env
from arcpy import mapping

arcpy.env.overwriteOutput = True

# Set Local Variable
A = "CUPS" #Layer you want to updat acres
mxd = arcpy.mapping.MapDocument("CURRENT")
# Create attribute called Acres
try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.Exists(A):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(A, "Acres", "DOUBLE")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Acres Attribute Added"
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Acres Field Not Added"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
except arcpy.ExecuteError:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Error Occured Add Acres Attribute Failed"
&amp;nbsp;&amp;nbsp;&amp;nbsp; print (arcpy.GetMessages(2))
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
# Create curser to update acres field
cur = arcpy.UpdateCursor(A)

# Pass through each row to update acres value
try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.Exists(A):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cur:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.Acres = row.Shape_Area /43560
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cur.updateRow(row)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Acres Updated"
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Acres Not Updated Feature Class Does Not Exist"
except arcpy.ExecuteError:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Error Occured Update Failed"
&amp;nbsp;&amp;nbsp;&amp;nbsp; print (arcpy.GetMessages(2))
del cur, row

arcpy.RefreshActiveView()
arcpy.RefreshTOC()
# Delete cursor and objects
del arcpy, env, A, mxd

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:46:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/acreage-script/m-p/684307#M52985</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2021-12-12T04:46:39Z</dc:date>
    </item>
  </channel>
</rss>

