<?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: FeatureClassToFeatureClass not respecting selection (from .py script) in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/featureclasstofeatureclass-not-respecting/m-p/1309291#M71191</link>
    <description>&lt;P&gt;Thank you, Dan - I appreciate the help.&amp;nbsp; I did try three different tools for this project:&amp;nbsp;&lt;/P&gt;&lt;P&gt;arcpy.conversion.FeatureClassToFeatureClass,&lt;/P&gt;&lt;P&gt;arcpy.management.CopyFeatures,&lt;/P&gt;&lt;P&gt;arcpy.conversion.FeatureClassToGeodatabase&lt;/P&gt;&lt;P&gt;and they all had the same problem.&amp;nbsp; I also tried a local file vs server file, with no change.&amp;nbsp; When I reduced the script down to the two commands (select, and copy) I still had the problem.&amp;nbsp; It's as if the selection command is holding the file hostage and not 'finishing' before it moves on to the copy command.&amp;nbsp; When I put the two commands in different scripts, and run them separately, they work (much like putting the two commands in the Python window).&amp;nbsp; Also, I have put the two commands in two separate functions, and no luck.&amp;nbsp; If you have any insight into forcing the select command to 'complete', I would be grateful!&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jul 2023 21:22:50 GMT</pubDate>
    <dc:creator>ChadChristensen</dc:creator>
    <dc:date>2023-07-18T21:22:50Z</dc:date>
    <item>
      <title>FeatureClassToFeatureClass not respecting selection (from .py script)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/featureclasstofeatureclass-not-respecting/m-p/1309115#M71158</link>
      <description>&lt;P&gt;I have ArcGIS Pro 2.5 right now, and there is a problem with having two different results when I execute code from the Python window vs. executing from a script.&amp;nbsp; The script version will not respect the selection when I copy one geodatabase class to a new one.&lt;/P&gt;&lt;P&gt;I have a point table called "spatial_j&lt;SPAN&gt;oin1" with 222 points.&amp;nbsp; I use arcpy.management.SelectLayerByAttribute to select 5 records.&amp;nbsp; That command works the same in the Python window and in the script.&amp;nbsp; I then use arcpy.onversion.FeatureClassToFeatureClass() to save those 5 records as a new layer.&amp;nbsp; If I execute that command in the Python window, I get 5 features in the new laye&lt;/SPAN&gt;&lt;SPAN&gt;r.&amp;nbsp; When I run the script with the same command, I get the full 222 record set.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_python.gif" style="width: 814px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/75642i451B6A39923CB0AC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_python.gif" alt="Screenshot_python.gif" /&gt;&lt;/span&gt;(this is the Python window version)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="python script" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/75638i98755F4C1D167A91/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_script.gif" alt="Screenshot_script.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;(this is the script version).&lt;/P&gt;&lt;P&gt;Am I using the wrong tool, or do I need a line in my script file to tell it to respect the selection?&lt;/P&gt;&lt;P&gt;Thanks for the help--&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 15:17:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/featureclasstofeatureclass-not-respecting/m-p/1309115#M71158</guid>
      <dc:creator>ChadChristensen</dc:creator>
      <dc:date>2023-07-18T15:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureClassToFeatureClass not respecting selection (from .py script)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/featureclasstofeatureclass-not-respecting/m-p/1309228#M71182</link>
      <description>&lt;P&gt;Selections are honored when using&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/copy-features.htm" target="_blank"&gt;Copy Features (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 18:44:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/featureclasstofeatureclass-not-respecting/m-p/1309228#M71182</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-07-18T18:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureClassToFeatureClass not respecting selection (from .py script)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/featureclasstofeatureclass-not-respecting/m-p/1309291#M71191</link>
      <description>&lt;P&gt;Thank you, Dan - I appreciate the help.&amp;nbsp; I did try three different tools for this project:&amp;nbsp;&lt;/P&gt;&lt;P&gt;arcpy.conversion.FeatureClassToFeatureClass,&lt;/P&gt;&lt;P&gt;arcpy.management.CopyFeatures,&lt;/P&gt;&lt;P&gt;arcpy.conversion.FeatureClassToGeodatabase&lt;/P&gt;&lt;P&gt;and they all had the same problem.&amp;nbsp; I also tried a local file vs server file, with no change.&amp;nbsp; When I reduced the script down to the two commands (select, and copy) I still had the problem.&amp;nbsp; It's as if the selection command is holding the file hostage and not 'finishing' before it moves on to the copy command.&amp;nbsp; When I put the two commands in different scripts, and run them separately, they work (much like putting the two commands in the Python window).&amp;nbsp; Also, I have put the two commands in two separate functions, and no luck.&amp;nbsp; If you have any insight into forcing the select command to 'complete', I would be grateful!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 21:22:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/featureclasstofeatureclass-not-respecting/m-p/1309291#M71191</guid>
      <dc:creator>ChadChristensen</dc:creator>
      <dc:date>2023-07-18T21:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureClassToFeatureClass not respecting selection (from .py script)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/featureclasstofeatureclass-not-respecting/m-p/1309330#M71199</link>
      <description>&lt;P&gt;strange... maybe try an intermediate "make feature layer" or write to "memory" workspace first&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/the-in-memory-workspace.htm" target="_blank"&gt;Write geoprocessing output to memory—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 23:49:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/featureclasstofeatureclass-not-respecting/m-p/1309330#M71199</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-07-18T23:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureClassToFeatureClass not respecting selection (from .py script)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/featureclasstofeatureclass-not-respecting/m-p/1312847#M71507</link>
      <description>&lt;P&gt;I found the answer in some very obscure text in the explanation of the tool.&amp;nbsp; This tool, when run as a script, will only show up in a DERIVED OUTPUT which has its own special conditions.&amp;nbsp; You can't just create the join and expect to see it reflected in the original layer.&amp;nbsp; The text says this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"To see the results of a join created in a script tool, the tool must include the layer as a&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/../../arcpy/geoprocessing_and_python/setting-script-tool-parameters.htm#GUID-59C4A61C-AC33-4BA3-8453-AC8328E34453" target="_blank" rel="noopener"&gt;derived output parameter&lt;/A&gt;&lt;SPAN&gt;.&amp;nbsp;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I wish this was more clear on the tool page, because this took days worth of struggle to work out.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 21:10:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/featureclasstofeatureclass-not-respecting/m-p/1312847#M71507</guid>
      <dc:creator>ChadChristensen</dc:creator>
      <dc:date>2023-07-27T21:10:33Z</dc:date>
    </item>
  </channel>
</rss>

