<?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: Arcpy adding selection layer to map adds all features, not just selection in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-adding-selection-layer-to-map-adds-all/m-p/1396365#M80375</link>
    <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/make-feature-layer.htm" target="_blank"&gt;Make Feature Layer (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If the Input Features parameter value is a layer, the input's symbology, selection, and definition query will be transferred to the output layer&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Are there 16 features, but only 9 selected?&amp;nbsp; I don't see anything about makefeaturelayer removing those that aren't in a selection.&amp;nbsp; Even SaveToLayerFile preserves selections without feature truncation&lt;/P&gt;&lt;P&gt;&amp;nbsp;-&lt;EM&gt; If the input layer has a selection applied to it, the output layer file will maintain this selection.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;CopyFeatures, however truncates those not selected&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If the input is a layer and has a selection, only the selected features are copied to the output feature class.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Mar 2024 00:09:32 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2024-03-15T00:09:32Z</dc:date>
    <item>
      <title>Arcpy adding selection layer to map adds all features, not just selection</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-adding-selection-layer-to-map-adds-all/m-p/1396361#M80371</link>
      <description>&lt;P&gt;Arcpy seems to be adding all features to a map, when I only tell it to add the selection layer. Any ideas what I can do to keep the filter on it? I am running the script from a custom toolbox in an active session.&lt;/P&gt;&lt;P&gt;selection = arcpy.management.SelectLayerByAttribute(layer, 'NEW_SELECTION', "OBJECTID IN {}".format(ready_to_delete))&lt;BR /&gt;selection_layer = arcpy.management.MakeFeatureLayer(selection[0]) #### 9 features&lt;BR /&gt;m.addLayer(selection_layer[0]) #### adds all 16 features for some reason&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Scosh_1-1710459627482.png" style="width: 815px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/98121i4C200FA844687C97/image-dimensions/815x55?v=v2" width="815" height="55" role="button" title="Scosh_1-1710459627482.png" alt="Scosh_1-1710459627482.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 23:41:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-adding-selection-layer-to-map-adds-all/m-p/1396361#M80371</guid>
      <dc:creator>Scosh</dc:creator>
      <dc:date>2024-03-14T23:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy adding selection layer to map adds all features, not just selection</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-adding-selection-layer-to-map-adds-all/m-p/1396365#M80375</link>
      <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/make-feature-layer.htm" target="_blank"&gt;Make Feature Layer (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If the Input Features parameter value is a layer, the input's symbology, selection, and definition query will be transferred to the output layer&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Are there 16 features, but only 9 selected?&amp;nbsp; I don't see anything about makefeaturelayer removing those that aren't in a selection.&amp;nbsp; Even SaveToLayerFile preserves selections without feature truncation&lt;/P&gt;&lt;P&gt;&amp;nbsp;-&lt;EM&gt; If the input layer has a selection applied to it, the output layer file will maintain this selection.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;CopyFeatures, however truncates those not selected&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If the input is a layer and has a selection, only the selected features are copied to the output feature class.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 00:09:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-adding-selection-layer-to-map-adds-all/m-p/1396365#M80375</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2024-03-15T00:09:32Z</dc:date>
    </item>
  </channel>
</rss>

