<?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: Model Builder Script for Calculating Geometry Attributes Using If Selection Exists Logic in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/model-builder-script-for-calculating-geometry/m-p/1099099#M62433</link>
    <description>&lt;P&gt;Now I get this&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;File "K:\GIS_TOOLS\Toolbox\Toolbox.tbx#GeoCalc_Toolbox.py", line 21&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;True_48, False_49 = # NOT IMPLEMENTED(in_layer_or_view=parcel_Layer, selection_condition="EXISTS", count=0, count_min=0, count_max=0)&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;</description>
    <pubDate>Thu, 16 Sep 2021 20:30:55 GMT</pubDate>
    <dc:creator>ABishop</dc:creator>
    <dc:date>2021-09-16T20:30:55Z</dc:date>
    <item>
      <title>Model Builder Script for Calculating Geometry Attributes Using If Selection Exists Logic</title>
      <link>https://community.esri.com/t5/python-questions/model-builder-script-for-calculating-geometry/m-p/1099086#M62431</link>
      <description>&lt;P&gt;I need HELP!&lt;/P&gt;&lt;P&gt;Quick Disclaimer:&amp;nbsp; I am NOT A PYTHON PROGRAMMER although I am trying to learn!&lt;/P&gt;&lt;P&gt;Here is the situation:&lt;/P&gt;&lt;P&gt;I am running ArcGISPro 2.8.&amp;nbsp; I have built a model which calculates geometry attributes for a feature class record if it is selected.&amp;nbsp; When I run the model manually without the script, it works, but when I export the model to a script, I get this error:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;File "K:\GIS_TOOLS\Toolbox\Toolbox.tbx#GeoCalc_NewToolbox.py", 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;See python window for the script.&amp;nbsp; &lt;STRONG&gt;Does anyone know why I am getting this error?&amp;nbsp; I have googled it and I can't seem to get anywhere.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":sad_but_relieved_face:"&gt;😥&lt;/span&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# -*- coding: utf-8 -*-
"""
Generated by ArcGIS ModelBuilder on : 2021-09-16 15:21:14
"""
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()
    print("Geometry Calculation Complete")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 20:12:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/model-builder-script-for-calculating-geometry/m-p/1099086#M62431</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-16T20:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Script for Calculating Geometry Attributes Using If Selection Exists Logic</title>
      <link>https://community.esri.com/t5/python-questions/model-builder-script-for-calculating-geometry/m-p/1099092#M62432</link>
      <description>&lt;P&gt;get rid of this line&lt;/P&gt;&lt;PRE&gt;def #  NOT  IMPLEMENTED# Function Body not implemented&lt;/PRE&gt;&lt;P&gt;you can't have a "def" that does nothing&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 20:19:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/model-builder-script-for-calculating-geometry/m-p/1099092#M62432</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-09-16T20:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Script for Calculating Geometry Attributes Using If Selection Exists Logic</title>
      <link>https://community.esri.com/t5/python-questions/model-builder-script-for-calculating-geometry/m-p/1099099#M62433</link>
      <description>&lt;P&gt;Now I get this&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;File "K:\GIS_TOOLS\Toolbox\Toolbox.tbx#GeoCalc_Toolbox.py", line 21&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;True_48, False_49 = # NOT IMPLEMENTED(in_layer_or_view=parcel_Layer, selection_condition="EXISTS", count=0, count_min=0, count_max=0)&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;</description>
      <pubDate>Thu, 16 Sep 2021 20:30:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/model-builder-script-for-calculating-geometry/m-p/1099099#M62433</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-16T20:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Script for Calculating Geometry Attributes Using If Selection Exists Logic</title>
      <link>https://community.esri.com/t5/python-questions/model-builder-script-for-calculating-geometry/m-p/1099125#M62435</link>
      <description>&lt;P&gt;&lt;EM&gt;True_48, False_49&lt;/EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;this line is garbage as well, it does nothing&lt;/P&gt;&lt;P&gt;There appears to be remnants of bits from the model that got carried over to the script.&lt;/P&gt;&lt;P&gt;It appears that has meant that the formatting is a bit of a mess.&lt;/P&gt;&lt;P&gt;the path to the data are quite convoluted.&lt;/P&gt;&lt;P&gt;Why do you want to get it to a script?&lt;/P&gt;&lt;P&gt;I suspect you are going to have to do a line by line cleanup&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 20:50:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/model-builder-script-for-calculating-geometry/m-p/1099125#M62435</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-09-16T20:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Script for Calculating Geometry Attributes Using If Selection Exists Logic</title>
      <link>https://community.esri.com/t5/python-questions/model-builder-script-for-calculating-geometry/m-p/1099130#M62436</link>
      <description>&lt;P&gt;OK i'll get rid of that part and see what happens.&amp;nbsp; &amp;nbsp;I plan to put it in an add-in button using ArcGIS Pro SDK Button Template.&amp;nbsp; I wasn't successful in calling up the model, so I exported it to a script.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 20:56:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/model-builder-script-for-calculating-geometry/m-p/1099130#M62436</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-16T20:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder Script for Calculating Geometry Attributes Using If Selection Exists Logic</title>
      <link>https://community.esri.com/t5/python-questions/model-builder-script-for-calculating-geometry/m-p/1099478#M62463</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/215600"&gt;@DanPatterson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I am going to just remove the logical operator from the model so I can export it as a script.&amp;nbsp; I'll just have to use the select by attributes to get null values and then calculate the geometry of all parcels with null values.&amp;nbsp; It won't hurt and since there aren't many, it shouldn't be noticeable to the person using the button.&lt;/P&gt;&lt;P&gt;Thank you for your input and time.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 17:50:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/model-builder-script-for-calculating-geometry/m-p/1099478#M62463</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-17T17:50:45Z</dc:date>
    </item>
  </channel>
</rss>

