<?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: how to delete features from the topology layer with arcpy.da in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-delete-features-from-the-topology-layer/m-p/1138911#M63622</link>
    <description>&lt;P&gt;I'm running in to this now as well.&amp;nbsp; Were you ever able to resolve this?&lt;/P&gt;</description>
    <pubDate>Mon, 31 Jan 2022 14:55:00 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2022-01-31T14:55:00Z</dc:date>
    <item>
      <title>how to delete features from the topology layer with arcpy.da</title>
      <link>https://community.esri.com/t5/python-questions/how-to-delete-features-from-the-topology-layer/m-p/329616#M25643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to delete all features from the SDE layer that has topology... the script fails on the arcpy.DeleteFeatures...&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR:&lt;/P&gt;&lt;P&gt;arcgisscripting.ExecuteError: ERROR 999999: Error executing function.&lt;BR /&gt;A class in the topology necessitates validation being run within an edit session. [county.GIS_SDE.BldgInsp]&lt;BR /&gt;Failed to execute (DeleteFeatures).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I have:&lt;/P&gt;&lt;P&gt;SDE_bldginsp = county_con + os.sep + "county.GIS_SDE.bldginsp"&amp;nbsp;&lt;/P&gt;&lt;P&gt;areafield =&amp;nbsp;"SHAPE.area"&lt;/P&gt;&lt;P&gt;&amp;nbsp;sde_concounty = sdeConnClass.SDE_Connection(gis_server, gis_dbcounty,'gis_sde','gis_sde')&lt;BR /&gt; county_con = sde_concounty.connection&lt;BR /&gt; gv.SDE_countyconnection = county_con&lt;/P&gt;&lt;P&gt;bldginspSDE_layer = "bldginsp_layer"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; arcpy.MakeFeatureLayer_management(SDE_bldginsp, bldginspSDE_layer, "", "", "")&lt;BR /&gt; query = areafield + " &amp;gt; 0"&lt;BR /&gt; arcpy.SelectLayerByAttribute_management(bldginspSDE_layer, "NEW_SELECTION", query) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try:&lt;BR /&gt;&amp;nbsp; &amp;nbsp;with arcpy.da.Editor(countyconnection) as edit:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;print " deleting old features." &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;arcpy.SelectLayerByAttribute_management(bldginspSDE_layer, "NEW_SELECTION", query) &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;arcpy.DeleteFeatures_management(bldginspSDE_layer)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;print "Deleted selected features from bldginsp " &lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;# APPEND local DORSalTx to SDE DORSalTx...&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;fclist = [bldginsp_county_city_erased]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;arcpy.Append_management(fclist, bldginspSDE_layer) &lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;msg = "bldginsp updated sucessfully"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;print msg&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;logging.info(msg)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;#print msg&lt;BR /&gt; &lt;BR /&gt; except arcpy.ExecuteError:&lt;BR /&gt; print(arcpy.GetMessages(2))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2017 17:23:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-delete-features-from-the-topology-layer/m-p/329616#M25643</guid>
      <dc:creator>HalinaLewandowski</dc:creator>
      <dc:date>2017-08-02T17:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete features from the topology layer with arcpy.da</title>
      <link>https://community.esri.com/t5/python-questions/how-to-delete-features-from-the-topology-layer/m-p/329617#M25644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I also ran into this. Were you able to ever find a solution?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2018 16:38:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-delete-features-from-the-topology-layer/m-p/329617#M25644</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-04-17T16:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to delete features from the topology layer with arcpy.da</title>
      <link>https://community.esri.com/t5/python-questions/how-to-delete-features-from-the-topology-layer/m-p/1138911#M63622</link>
      <description>&lt;P&gt;I'm running in to this now as well.&amp;nbsp; Were you ever able to resolve this?&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 14:55:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-delete-features-from-the-topology-layer/m-p/1138911#M63622</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-01-31T14:55:00Z</dc:date>
    </item>
  </channel>
</rss>

