<?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 Calculate Geometry Attributes causing AttributeError in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368495#M69603</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I am currently trying to create a script to automate parcel updates. I built the original script in a Notebook that works perfectly fine in Pro but now that I am trying to recreate it as a stand-alone script, I am running into some hiccups. My current sticking point is trying to calculate geometry attributes. It is coming back with the error:&amp;nbsp;AttributeError: 'module' object has no attribute 'CalculateGeometryAttributes'&lt;/P&gt;&lt;P&gt;I have tried a couple of things based on what I have found on the web pertaining to this error. First, I tried using&amp;nbsp;&lt;SPAN&gt;arcpy.CalculateGeometryAttributes_management instead of&amp;nbsp;arcpy.management.CalculateGeometryAttributes but no luck. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I then tried to create a variable for the parameters since there is so much text and that also did not work.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am able to run the geoprocessing tool&amp;nbsp;&lt;EM&gt;in Pro&lt;/EM&gt; once the layers have been created with the script, the tool just isn't working in the script.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any thoughts?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is how I have it set up in the script:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;arcpy.CalculateGeometryAttributes_management(out_data_py,&lt;BR /&gt;                                             &lt;SPAN&gt;"ACRE AREA"&lt;/SPAN&gt;,&lt;BR /&gt;                                             &lt;SPAN&gt;''&lt;/SPAN&gt;,&lt;BR /&gt;                                             &lt;SPAN&gt;"ACRES"&lt;/SPAN&gt;,&lt;BR /&gt;                                             &lt;SPAN&gt;'PROJCS["NAD_1983_StatePlane_Kansas_North_FIPS_1501_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["Lambert_Conformal_Conic"],PARAMETER["False_Easting",1312333.333333333],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-98.0],PARAMETER["Standard_Parallel_1",38.71666666666667],PARAMETER["Standard_Parallel_2",39.78333333333333],PARAMETER["Latitude_Of_Origin",38.33333333333334],UNIT["Foot_US",0.3048006096012192]]'&lt;/SPAN&gt;,&lt;BR /&gt;                                             &lt;SPAN&gt;"SAME_AS_INPUT"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"Acreage Calculated"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;I am fairly new to writing Python scripts for automation so I apologize if this isn't very clear or if I haven't included enough info. It's a fairly long script (for me) so I didn't want to share a bunch of superfluous text but if it's needed, I can add more for context.&amp;nbsp;Thank you for looking!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jan 2024 18:13:15 GMT</pubDate>
    <dc:creator>Christian_Kennedy</dc:creator>
    <dc:date>2024-01-10T18:13:15Z</dc:date>
    <item>
      <title>Calculate Geometry Attributes causing AttributeError</title>
      <link>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368495#M69603</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I am currently trying to create a script to automate parcel updates. I built the original script in a Notebook that works perfectly fine in Pro but now that I am trying to recreate it as a stand-alone script, I am running into some hiccups. My current sticking point is trying to calculate geometry attributes. It is coming back with the error:&amp;nbsp;AttributeError: 'module' object has no attribute 'CalculateGeometryAttributes'&lt;/P&gt;&lt;P&gt;I have tried a couple of things based on what I have found on the web pertaining to this error. First, I tried using&amp;nbsp;&lt;SPAN&gt;arcpy.CalculateGeometryAttributes_management instead of&amp;nbsp;arcpy.management.CalculateGeometryAttributes but no luck. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I then tried to create a variable for the parameters since there is so much text and that also did not work.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am able to run the geoprocessing tool&amp;nbsp;&lt;EM&gt;in Pro&lt;/EM&gt; once the layers have been created with the script, the tool just isn't working in the script.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any thoughts?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is how I have it set up in the script:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;arcpy.CalculateGeometryAttributes_management(out_data_py,&lt;BR /&gt;                                             &lt;SPAN&gt;"ACRE AREA"&lt;/SPAN&gt;,&lt;BR /&gt;                                             &lt;SPAN&gt;''&lt;/SPAN&gt;,&lt;BR /&gt;                                             &lt;SPAN&gt;"ACRES"&lt;/SPAN&gt;,&lt;BR /&gt;                                             &lt;SPAN&gt;'PROJCS["NAD_1983_StatePlane_Kansas_North_FIPS_1501_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["Lambert_Conformal_Conic"],PARAMETER["False_Easting",1312333.333333333],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-98.0],PARAMETER["Standard_Parallel_1",38.71666666666667],PARAMETER["Standard_Parallel_2",39.78333333333333],PARAMETER["Latitude_Of_Origin",38.33333333333334],UNIT["Foot_US",0.3048006096012192]]'&lt;/SPAN&gt;,&lt;BR /&gt;                                             &lt;SPAN&gt;"SAME_AS_INPUT"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"Acreage Calculated"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;I am fairly new to writing Python scripts for automation so I apologize if this isn't very clear or if I haven't included enough info. It's a fairly long script (for me) so I didn't want to share a bunch of superfluous text but if it's needed, I can add more for context.&amp;nbsp;Thank you for looking!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 18:13:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368495#M69603</guid>
      <dc:creator>Christian_Kennedy</dc:creator>
      <dc:date>2024-01-10T18:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Geometry Attributes causing AttributeError</title>
      <link>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368515#M69604</link>
      <description>&lt;P&gt;How are you importing the modules?&amp;nbsp; Just import arcpy or are you doing anything different?&lt;/P&gt;&lt;P&gt;Are you running from the same Python environment as Pro?&amp;nbsp; e.g. having an old ArcMap install.&lt;/P&gt;&lt;P&gt;I'd recommend trying the below syntax to access it via the arcpy.management submodule rather than _management.&lt;/P&gt;&lt;PRE&gt;arcpy.management.CalculateGeometryAttributes(in_features, geometry_property, {length_unit}, {area_unit}, {coordinate_system}, {coordinate_format})&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 18:58:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368515#M69604</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2024-01-10T18:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Geometry Attributes causing AttributeError</title>
      <link>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368537#M69607</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/167692"&gt;@DavidPike&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;I am running from the same environment as the Pro environment...I have several modules I've imported including arcpy, datetime, time and os. I made sure to use arcpy.management.CalculateGeometryAttributes instead of&amp;nbsp;arcpy.CalculateGeometryAttributes_management but I still got the same error. What's goofy is I am able to use other data management geoprocessing tools earlier in the script and they work just fine. It's just when I get to calc geometry that it bombs. So it must be a problem with the submodule and how I have some of the parameters entered. That makes the most sense to me right now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 19:24:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368537#M69607</guid>
      <dc:creator>Christian_Kennedy</dc:creator>
      <dc:date>2024-01-10T19:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Geometry Attributes causing AttributeError</title>
      <link>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368546#M69608</link>
      <description>&lt;LI-CODE lang="python"&gt;arcpy.CalculateGeometryAttributes_management(out_data_py,
                                             [["ACRE", "AREA"]],
                                             '',
                                             "ACRES",
                                             'PROJCS["NAD_1983_StatePlane_Kansas_North_FIPS_1501_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["Lambert_Conformal_Conic"],PARAMETER["False_Easting",1312333.333333333],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-98.0],PARAMETER["Standard_Parallel_1",38.71666666666667],PARAMETER["Standard_Parallel_2",39.78333333333333],PARAMETER["Latitude_Of_Origin",38.33333333333334],UNIT["Foot_US",0.3048006096012192]]',
                                             "SAME_AS_INPUT")
print("Acreage Calculated")&lt;/LI-CODE&gt;&lt;P&gt;yes your syntax looks different from the format shown in the help.&amp;nbsp; I've adjusted the 2nd argument for the tool.&amp;nbsp; I'd also try without specifying the input coordinate system as the last argument and see if that's causing the issue.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 19:36:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368546#M69608</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2024-01-10T19:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Geometry Attributes causing AttributeError</title>
      <link>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368581#M69610</link>
      <description>&lt;P&gt;Welp, I corrected the syntax and tried it multiple times. I tried without specifying that last argument. Then I started really messing around and just throwing stuff at the wall in those last two arguments and I'm still getting the same error. I am just stumped.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 20:09:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368581#M69610</guid>
      <dc:creator>Christian_Kennedy</dc:creator>
      <dc:date>2024-01-10T20:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Geometry Attributes causing AttributeError</title>
      <link>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368649#M69612</link>
      <description>&lt;P&gt;If I run the tool in Pro, then right click on the job in the History pane and "Copy Python Command" I came up with this, that seems to work in script.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.management.CalculateGeometryAttributes(
    in_features=out_data_py,
    geometry_property="area AREA",
    length_unit="",
    area_unit="ACRES",
    coordinate_system='PROJCS["NAD_1983_StatePlane_Kansas_North_FIPS_1501_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["Lambert_Conformal_Conic"],PARAMETER["False_Easting",1312333.333333333],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-98.0],PARAMETER["Standard_Parallel_1",38.71666666666667],PARAMETER["Standard_Parallel_2",39.78333333333333],PARAMETER["Latitude_Of_Origin",38.33333333333334],UNIT["Foot_US",0.3048006096012192]]',
    coordinate_format="SAME_AS_INPUT"
)&lt;/LI-CODE&gt;&lt;P&gt;Does this work for you?&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 21:41:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368649#M69612</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2024-01-10T21:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Geometry Attributes causing AttributeError</title>
      <link>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368654#M69613</link>
      <description>&lt;P&gt;Sadly, it does not. I've done the same. I've copied the python command from the history pane in pro and put it into the script and it hasn't worked yet. I tried again with the syntax from your comment and it still doesn't work &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&amp;nbsp; Thank you for the suggestion!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 21:47:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368654#M69613</guid>
      <dc:creator>Christian_Kennedy</dc:creator>
      <dc:date>2024-01-10T21:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Geometry Attributes causing AttributeError</title>
      <link>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368926#M69627</link>
      <description>&lt;P&gt;Have you tried adding the script to a toolbox as a script tool then put the script in a model and schedule it? Now that you can schedule any model easily, I have stopped using stand alone scripts when possible and just create a new model and schedule it. This has worked flawlessly for over a year running scripts nightly.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 14:55:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368926#M69627</guid>
      <dc:creator>LeeAllen</dc:creator>
      <dc:date>2024-01-11T14:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Geometry Attributes causing AttributeError</title>
      <link>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368934#M69628</link>
      <description>&lt;P&gt;I have not yet tried that but that's a good idea. Thanks, Lee!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 15:06:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1368934#M69628</guid>
      <dc:creator>Christian_Kennedy</dc:creator>
      <dc:date>2024-01-11T15:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Geometry Attributes causing AttributeError</title>
      <link>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1369248#M69637</link>
      <description>&lt;P&gt;what specifically are you trying to do with the entire tool and what version of Pro are you on?&amp;nbsp; You could likely set up a couple attribute rules to do your calculations on the fly as anything changes in your data.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;This arcade expression set up as an attribute rule will update the acres calculation any time the geometry changes.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var acres = $feature.area; //whatever the name of the field is you are wanting to calculate
//Check if the geometry of the feature has changed during the last edit
if(Geometry($feature) != Geometry($originalFeature)) {
	//if it has, calculate the new acreage
	acres = Area($feature, 'acres');
}
//update the area field with the new calculation or just return the original value
return acres;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and if you don't care if it calculates the area for every edit regardless of whether you touched the geometry or not then it is as simple as this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return Area($feature, 'acres')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there are other processing tools updating different fields/etc.. earlier on in the script or afterwards, it is likely some simple attribute rules could be set up for them as well.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 22:17:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1369248#M69637</guid>
      <dc:creator>dhaag</dc:creator>
      <dc:date>2024-01-11T22:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Geometry Attributes causing AttributeError</title>
      <link>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1369732#M69642</link>
      <description>&lt;P&gt;I figured it out! I THOUGHT I was running the same Python environment as Pro but I was running the Python env for ArcMap! Ugggghhhhh...I had checked but was not thorough enough apparently. But it's fixed and it's working now. Good gravy, what a relief.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2024 18:24:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1369732#M69642</guid>
      <dc:creator>Christian_Kennedy</dc:creator>
      <dc:date>2024-01-12T18:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Geometry Attributes causing AttributeError</title>
      <link>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1641870#M74601</link>
      <description>&lt;P&gt;Hi Christian, I am having the same issues, would you mind explaining how you set the python environment as Pro.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2025 05:33:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-geometry-attributes-causing/m-p/1641870#M74601</guid>
      <dc:creator>HowardJohnston</dc:creator>
      <dc:date>2025-08-14T05:33:04Z</dc:date>
    </item>
  </channel>
</rss>

