<?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 Python Script developed with Arc 10.2.1 breaks in 10.3 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-script-developed-with-arc-10-2-1-breaks-in/m-p/412484#M32463</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wrote a script the runs through a database and based on certain criteria deletes out data.&amp;nbsp; I run this to clear the way for new updated data that will be loaded.&amp;nbsp; It checks what the name starts with ("p*" or "a*"-- that type of thing) and it also checks the geometry type-- which is where it seems to be running into trouble.&amp;nbsp; The error crops up when it gets to the line features saying that shapetype "Polyline" or "Line" doesn't exist.&amp;nbsp; It still recognized shapetype "Point" and it hasn't even gotten to shapetype "Polygon" yet because it crashes before that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I query the shapetype via the python command window in arc it still says "Polyline" for the line files, so I don't understand where the problem is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This script run perfectly in 10.2.1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Jul 2016 20:37:03 GMT</pubDate>
    <dc:creator>JohnCunningham2</dc:creator>
    <dc:date>2016-07-18T20:37:03Z</dc:date>
    <item>
      <title>Python Script developed with Arc 10.2.1 breaks in 10.3</title>
      <link>https://community.esri.com/t5/python-questions/python-script-developed-with-arc-10-2-1-breaks-in/m-p/412484#M32463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wrote a script the runs through a database and based on certain criteria deletes out data.&amp;nbsp; I run this to clear the way for new updated data that will be loaded.&amp;nbsp; It checks what the name starts with ("p*" or "a*"-- that type of thing) and it also checks the geometry type-- which is where it seems to be running into trouble.&amp;nbsp; The error crops up when it gets to the line features saying that shapetype "Polyline" or "Line" doesn't exist.&amp;nbsp; It still recognized shapetype "Point" and it hasn't even gotten to shapetype "Polygon" yet because it crashes before that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I query the shapetype via the python command window in arc it still says "Polyline" for the line files, so I don't understand where the problem is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This script run perfectly in 10.2.1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jul 2016 20:37:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-developed-with-arc-10-2-1-breaks-in/m-p/412484#M32463</guid>
      <dc:creator>JohnCunningham2</dc:creator>
      <dc:date>2016-07-18T20:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script developed with Arc 10.2.1 breaks in 10.3</title>
      <link>https://community.esri.com/t5/python-questions/python-script-developed-with-arc-10-2-1-breaks-in/m-p/412485#M32464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you refer to "&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;based on certain criteria deletes out data&lt;/SPAN&gt;", do you mean you delete the entire feature class or delete features within the feature class?&amp;nbsp; This of course would change how you access the data you are trying to delete.&amp;nbsp; For entire feature classes...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shape types are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Polygon&lt;/LI&gt;&lt;LI&gt;Polyline&lt;/LI&gt;&lt;LI&gt;Point&lt;/LI&gt;&lt;LI&gt;Multipoint&lt;/LI&gt;&lt;LI&gt;MultiPatch&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From your tags, I would assume you are utilizing some form of arcpy.Describe?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like this example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;import &lt;/SPAN&gt;arcpy
arcpy.env.workspace = &lt;SPAN style="color: #a5c261;"&gt;r'Database Connections\your database connection.sde'&lt;/SPAN&gt;

&lt;SPAN style="color: #a5c261;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #a5c261;"&gt;
&lt;/SPAN&gt;feature_list = arcpy.ListFeatureClasses()

&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;for &lt;/SPAN&gt;feature &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;in &lt;/SPAN&gt;feature_list:
&amp;nbsp; desc = arcpy.Describe(feature)
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;if &lt;/SPAN&gt;desc.shapetype == &lt;SPAN style="color: #a5c261;"&gt;'Polyline'&lt;/SPAN&gt;:
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;print &lt;/SPAN&gt;desc.name&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you post a snippet of your code and the exact error message? That would be very helpful in investigating. I am wondering if there is some other operation that is interfering with your delete.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:43:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-developed-with-arc-10-2-1-breaks-in/m-p/412485#M32464</guid>
      <dc:creator>AlexanderBrown5</dc:creator>
      <dc:date>2021-12-11T18:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script developed with Arc 10.2.1 breaks in 10.3</title>
      <link>https://community.esri.com/t5/python-questions/python-script-developed-with-arc-10-2-1-breaks-in/m-p/412486#M32465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for l in lList:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; L = format(l)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LN = os.path.basename(L)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lDesc = arcpy.Describe(L)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if lDesc.shapetype == "Polyline':&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sel_1 = arcpy.SelectLayerbyLocation(L, "WITHIN", aoiNew, "", "New_Selection")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cnt_1 = arcpy.GetCount_management(sel_1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if cnt_1 != 0:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.DeleteFeatures_management(L)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print ("No Features to delete")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is it, more or less.&amp;nbsp; It deletes features within an aoi, not an entire feature class.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 12:57:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-developed-with-arc-10-2-1-breaks-in/m-p/412486#M32465</guid>
      <dc:creator>JohnCunningham2</dc:creator>
      <dc:date>2016-07-19T12:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script developed with Arc 10.2.1 breaks in 10.3</title>
      <link>https://community.esri.com/t5/python-questions/python-script-developed-with-arc-10-2-1-breaks-in/m-p/412487#M32466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that is an exact snippet of your code, your quotes around Polyline do not match.&amp;nbsp; You have a " closed by a ' in:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14689380918446816 jive_text_macro" data-renderedposition="109.81533813476562_7.997159004211426_1332_15" jivemacro_uid="_14689380918446816"&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;if IDESC.shapetype == &lt;SPAN style="color: #e23d39;"&gt;"&lt;/SPAN&gt;Polyline&lt;SPAN style="color: #e23d39;"&gt;'&lt;/SPAN&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would certainly cause your issue failing on this type of feature.&amp;nbsp; However, your python IDE shouldn't even let you run this.&amp;nbsp; You would get a&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;SyntaxError: EOL while scanning string literal&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if your code displays this same type of quote mismatch.&amp;nbsp; If not, I'll take a further look.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 14:24:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-developed-with-arc-10-2-1-breaks-in/m-p/412487#M32466</guid>
      <dc:creator>AlexanderBrown5</dc:creator>
      <dc:date>2016-07-19T14:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script developed with Arc 10.2.1 breaks in 10.3</title>
      <link>https://community.esri.com/t5/python-questions/python-script-developed-with-arc-10-2-1-breaks-in/m-p/412488#M32467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was just a typographical error when I was typing here.&amp;nbsp; The script it correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It suddenly started working now.&amp;nbsp; I think it may have been be having issues because the toolbox was reaching across a network for the script.&amp;nbsp; It seems to be fine now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 16:59:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-developed-with-arc-10-2-1-breaks-in/m-p/412488#M32467</guid>
      <dc:creator>JohnCunningham2</dc:creator>
      <dc:date>2016-07-19T16:59:53Z</dc:date>
    </item>
  </channel>
</rss>

