<?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 Re: Python Script to Calculate Geometry Attributes from Selected Feature in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099482#M62466</link>
    <description>&lt;P&gt;Well, post the full script you export that actually runs and describe the logical operation you'd like it to have. We'll come up with a solution together.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Sep 2021 18:07:36 GMT</pubDate>
    <dc:creator>BlakeTerhune</dc:creator>
    <dc:date>2021-09-17T18:07:36Z</dc:date>
    <item>
      <title>Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098022#M62382</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I am running ArcGIS Pro 2.8.&amp;nbsp; I am also experimenting with Visual Studio to build an add-in with a button.&amp;nbsp; I want the button to run a python script which calculates the geometry attributes (acres) of a selected polygon and then I plan to make the add-in button available to our users in the office.&amp;nbsp; I was going to build a model in ArcGIS Pro which uses the "Calculate Geometry Attributes" tool to do this, but I quickly realized a few issues: #1 use the feature that is hard coded to my profile path and #2 not sure it will allow me to add a parameter to require the use to select the feature they want calculated due to the the issue with #3 the data source is a polygon stored in an SDE which is versioned.&amp;nbsp; Any suggestions?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 13:32:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098022#M62382</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-14T13:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098050#M62383</link>
      <description>&lt;P&gt;With arcpy, you can find the layer you want by looking at the data source, validate if a feature is selected, and run calculate field on the layer (so it only calculates the selected field). You may need to use the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/editor.htm" target="_self"&gt;Editor class&lt;/A&gt; to start and stop an edit session. Alternatively, you could put that responsibility on the user to start an edit session. Catch and handle the error that arises when not in an edit session and display a helpful message in the geoprocessing results indicating to the user what they need to do.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 14:19:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098050#M62383</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-09-14T14:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098051#M62384</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/191789"&gt;@BlakeTerhune&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply.&amp;nbsp; I am not a python programmer, but I have written python code from models and geoprocessing tasks in ArcGIS Pro.&amp;nbsp; Would you be so kind to point me to the specific tools and the order I should run them in the model?&amp;nbsp; I would then use the model to create a python script which would be executed in the add-in button "On Click" function.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 14:23:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098051#M62384</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-14T14:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098069#M62385</link>
      <description>&lt;P&gt;I'm not sure about making a custom selection and validating it with a model, but here are the tools I would use for writing my Python script.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Find the layer you want to work on using the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/layer-class.htm#C_GUID-AE1B6592-5077-4B14-AFF1-BE41E81538CC" target="_self"&gt;mapping module (arcpy.mp)&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Validate there is a selection with the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/layer-class.htm" target="_self"&gt;layer&lt;/A&gt;'s&amp;nbsp;getSelectionSet() method (throw Exception if exactly one record is not selected.)&lt;/LI&gt;&lt;LI&gt;Start an &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/editor.htm" target="_self"&gt;arcpy Editor&lt;/A&gt;. Test without the Editor first in case it just works. I don't think you need it for calculate field.&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/add-geometry-attributes.htm" target="_self"&gt;Add geometry attributes&lt;/A&gt;. Only the&amp;nbsp;selected features will have values calculated in the added fields; all other features will have null values. If this is not what you want, maybe try &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field.htm" target="_self"&gt;Calculate Field&lt;/A&gt; with the shape field.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Tue, 14 Sep 2021 14:51:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098069#M62385</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-09-14T14:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098160#M62391</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/191789"&gt;@BlakeTerhune&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again for the information but its not exactly what I am trying to do with this workflow.&amp;nbsp; The mapping module requires that I have a set project for this button to work and unfortunately our users all have their own projects and edit versions.&amp;nbsp; I would basically need to set the selection request from the user and have them select the feature.&amp;nbsp; Based on their selection, the calculation of the geometry attribute would occur.&amp;nbsp; I am looking into doing a model with parameters but having difficulty with that as well.&lt;/P&gt;&lt;P&gt;Amanda&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 17:25:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098160#M62391</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-14T17:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098193#M62394</link>
      <description>&lt;P&gt;You can get the "current" project that is open running the script.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/guidelines-for-arcpy-mapping.htm#ESRI_SECTION1_F3B0E966F3814596B8A5931FEA59DA6D" target="_blank"&gt;Guidelines for arcpy.mp—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject('current')&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 14 Sep 2021 19:21:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098193#M62394</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-09-14T19:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098383#M62407</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/191789"&gt;@BlakeTerhune&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OK... so aprx is a variable correct?&amp;nbsp; Would I need to call up a selection of the polygon feature class also?&amp;nbsp; I want to use this in the calculate geometry attributes tool as an input.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 12:37:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098383#M62407</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-15T12:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098573#M62415</link>
      <description>&lt;P&gt;Yes, &lt;FONT face="courier new,courier"&gt;aprx&lt;/FONT&gt; is the variable name for the current ArcGISProject object in the line of code I posted. Once you have that project, you will need to identify the Map in the project you want. If you know it by name for everyone, that's best. Otherwise, you'd have to look at all the maps to find a layer with the feature class name you want. Once you find the layer (by name) in the map of the project, step 1 I described above is complete.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 17:30:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098573#M62415</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-09-15T17:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098581#M62416</link>
      <description>&lt;P&gt;I want to use "current" so that when they open whatever project they have with the layer "parcel" for instance, that I can just find the selection made in the "parcel" layer and perform the calculate geometry attributes geoprocessing tool on the current selection.&amp;nbsp; This really shouldn't be this hard, but I am terrible with writing code from scratch and therefore having to do a lot of reading to figure out the correct format.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 17:41:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098581#M62416</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-15T17:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098972#M62424</link>
      <description>&lt;P&gt;Is it safe to assume the layer will always have the same name ("parcel") or would it be better to check the data source of the layer for the feature class name?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 16:10:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098972#M62424</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-09-16T16:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098991#M62425</link>
      <description>&lt;P&gt;Probably check the data source of the layer for the feature class name.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 16:43:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1098991#M62425</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-16T16:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099008#M62426</link>
      <description>&lt;P&gt;Is there any chance the same parcel feature class would be added as a layer to the map more than once? Or would the parcel layer be present in more than one map in the project?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 17:29:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099008#M62426</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-09-16T17:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099012#M62427</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/191789"&gt;@BlakeTerhune&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again... thank you so much for your assistance!&lt;/P&gt;&lt;P&gt;OK.. so I did some more research and I found out that there is a logical function in the ModelBuilder.&amp;nbsp; Its called "If Selection Exists".&amp;nbsp; To test this, I built a model with "Select by Attributes" (where "GIS_ACRES IS NULL") then used the logical function "If Selection Exists" to check if a selection is made on the "parcel" feature class and if the logical function returns true, then the "Calculate Geometry Attributes" occurs on the "GIS_ACRES" field.&amp;nbsp; To make sure this worked on the particular parcel i had selected, I made the GIS_ACRES field "null".&amp;nbsp; I exported the script from the model and ran it inside the project I had open with the parcel feature class selected and the script returned an error:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;File "&amp;lt;string&amp;gt;", line 6&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;def # NOT IMPLEMENTED# Function Body not implemented&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;^&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;SyntaxError: invalid syntax&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;HELLLLPPPPPP!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":sad_but_relieved_face:"&gt;😥&lt;/span&gt;&amp;nbsp; See python code window for the model builder code that I&amp;nbsp;used.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# -*- coding: utf-8 -*-
"""
Generated by ArcGIS ModelBuilder on : 2021-09-16 13:37:29
"""
import arcpy
def #  NOT  IMPLEMENTED# Function Body not implemented

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"):
        parcel = "I:\\users\\abishop\\DATA\\CadastreCopy.gdb\\parcel"

        # Process: Select Layer By Attribute (Select Layer By Attribute) (management)
        parcel_Layer, Count = arcpy.management.SelectLayerByAttribute(in_layer_or_view=parcel, selection_type="NEW_SELECTION", where_clause="GIS_ACRES IS NULL", invert_where_clause="")

        # Process: If Selection Exists (If Selection Exists) ()
        True_48, False_49 = #  NOT  IMPLEMENTED(in_layer_or_view=parcel_Layer, selection_condition="EXISTS", count=0, count_min=0, count_max=0)

        # Process: Calculate Geometry Attributes (Calculate Geometry Attributes) (management)
        if True_48:
            parcel_Layer_2_ = arcpy.management.CalculateGeometryAttributes(in_features=parcel_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()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 17:42:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099012#M62427</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-16T17:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099014#M62428</link>
      <description>&lt;P&gt;Sorry I just sent you a message and then I saw your question.&amp;nbsp; Yes, there is a chance.&amp;nbsp; Each user has control over their own project, and without me looking at their projects individually, I can't say for sure.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 17:45:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099014#M62428</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-16T17:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099019#M62429</link>
      <description>&lt;P&gt;OK... So after I sent you that last message with the python code from the ModelBuilder, I ran the model itself while in the project with the feature class selected and a "null" in the GIS_ACRES field.... and it ran but then I got a warning.&amp;nbsp; I am assuming it is because the GIS_ACRES field only accepts so many characters and I really do need the acreage calculation to be two decimal points.&amp;nbsp; Is there a way to control this?&amp;nbsp; (see pics attached for the warning and the calculated value in the selected feature)&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 17:58:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099019#M62429</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-16T17:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099394#M62451</link>
      <description>&lt;P&gt;Sorry, I didn't get a message and haven't had a chance to look closely at the screenshots. But regarding that error, simply deleting line 6 in that code you posted will resolve the syntax error.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 15:26:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099394#M62451</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-09-17T15:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099416#M62453</link>
      <description>&lt;P&gt;I tried that and it didn't work.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 16:12:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099416#M62453</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-17T16:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099465#M62458</link>
      <description>&lt;P&gt;Didn't work as in you got an error or it did something unexpected? If an error, include the entire error message with traceback.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 17:31:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099465#M62458</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-09-17T17:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099468#M62459</link>
      <description>&lt;P&gt;See python window for code I ran without the lines you said to remove and the error message.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# -*- coding: utf-8 -*-
"""
Generated by ArcGIS ModelBuilder on : 2021-09-17 08:27:10
"""
import arcpy

def GeometryCalc():  # GeometryCalc

    # To allow overwriting outputs change overwriteOutput option to True.
    arcpy.env.overwriteOutput = True

    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"):
        parcel = "I:\\users\\abishop\\DATA\\CadastreCopy.gdb\\parcel"

        # Process: Select Layer By Attribute (Select Layer By Attribute) (management)
        parcel_Layer, Count = arcpy.management.SelectLayerByAttribute(in_layer_or_view=parcel, selection_type="NEW_SELECTION", where_clause="GIS_ACRES IS NULL", invert_where_clause="")

        # Process: Calculate Geometry Attributes (Calculate Geometry Attributes) (management)
        if True_48:
            parcel_Layer_2_ = arcpy.management.CalculateGeometryAttributes(in_features=parcel_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()
Traceback (most recent call last):
  File "&amp;lt;string&amp;gt;", line 25, in &amp;lt;module&amp;gt;
  File "&amp;lt;string&amp;gt;", line 21, in GeometryCalc
NameError: name 'True_48' is not defined&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 17 Sep 2021 17:37:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099468#M62459</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-17T17:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Calculate Geometry Attributes from Selected Feature</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099472#M62460</link>
      <description>&lt;P&gt;I think as&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/96611"&gt;@DarrenWiens2&lt;/a&gt;&amp;nbsp;mentioned in &lt;A href="https://community.esri.com/t5/python-questions/check-if-any-features-are-selected/m-p/1099427/highlight/true#M62455" target="_self"&gt;the other thread&lt;/A&gt;, something appears to have gotten messed up when exporting this script from the model. Maybe try exporting it again.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 17:42:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-calculate-geometry-attributes/m-p/1099472#M62460</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-09-17T17:42:11Z</dc:date>
    </item>
  </channel>
</rss>

