<?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: get data from selected features in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-data-from-selected-features/m-p/850778#M3822</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understand you correctly, you're wanting to create a selection, and then export the results to .xls.&lt;/P&gt;&lt;P&gt;Here's how I would do it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Import libary&lt;BR /&gt;import arcpy&lt;BR /&gt;from arcpy import env&lt;/P&gt;&lt;P&gt;# Set variables&lt;BR /&gt;yourworkspace = "path to your workspace"&lt;BR /&gt;yourfeatureclass = "path to your feature class"&lt;BR /&gt;outputlocation = "path to your output folder"&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = yourworkspace&lt;/P&gt;&lt;P&gt;# Make Layer&lt;BR /&gt;arcpy.MakeFeatureLayer_management (yourfeatureclass, "featureclasslayer")&lt;/P&gt;&lt;P&gt;# Create selection&lt;BR /&gt;arcpy.SelectLayerByAttribute_management ("featureclasslayer", "NEW_SELECTION" ["build your selection criteria here"])&lt;/P&gt;&lt;P&gt;# Copy the results of your selection to a new feature class&lt;BR /&gt;arcpy.CopyFeatures_management ("featureclasslayer", "yourselectedfeatures")&lt;/P&gt;&lt;P&gt;# Export to Excel&lt;BR /&gt;TableToExcel_conversion ("yourselectedfeatures", "yourexcefilename.xls")&lt;/P&gt;&lt;P&gt;# Finish&lt;/P&gt;&lt;P&gt;raise SystemExit(0)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Jul 2018 15:45:54 GMT</pubDate>
    <dc:creator>deleted-user-qpvAI3Fo0MKR</dc:creator>
    <dc:date>2018-07-18T15:45:54Z</dc:date>
    <item>
      <title>get data from selected features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-data-from-selected-features/m-p/850777#M3821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to &lt;SPAN&gt;get the attribute values from selected features&lt;/SPAN&gt; and export them to an excel file using python?&amp;nbsp; If so, how do i go about it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2018 14:56:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-data-from-selected-features/m-p/850777#M3821</guid>
      <dc:creator>TanyaMthet</dc:creator>
      <dc:date>2018-07-18T14:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: get data from selected features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-data-from-selected-features/m-p/850778#M3822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understand you correctly, you're wanting to create a selection, and then export the results to .xls.&lt;/P&gt;&lt;P&gt;Here's how I would do it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Import libary&lt;BR /&gt;import arcpy&lt;BR /&gt;from arcpy import env&lt;/P&gt;&lt;P&gt;# Set variables&lt;BR /&gt;yourworkspace = "path to your workspace"&lt;BR /&gt;yourfeatureclass = "path to your feature class"&lt;BR /&gt;outputlocation = "path to your output folder"&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = yourworkspace&lt;/P&gt;&lt;P&gt;# Make Layer&lt;BR /&gt;arcpy.MakeFeatureLayer_management (yourfeatureclass, "featureclasslayer")&lt;/P&gt;&lt;P&gt;# Create selection&lt;BR /&gt;arcpy.SelectLayerByAttribute_management ("featureclasslayer", "NEW_SELECTION" ["build your selection criteria here"])&lt;/P&gt;&lt;P&gt;# Copy the results of your selection to a new feature class&lt;BR /&gt;arcpy.CopyFeatures_management ("featureclasslayer", "yourselectedfeatures")&lt;/P&gt;&lt;P&gt;# Export to Excel&lt;BR /&gt;TableToExcel_conversion ("yourselectedfeatures", "yourexcefilename.xls")&lt;/P&gt;&lt;P&gt;# Finish&lt;/P&gt;&lt;P&gt;raise SystemExit(0)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2018 15:45:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-data-from-selected-features/m-p/850778#M3822</guid>
      <dc:creator>deleted-user-qpvAI3Fo0MKR</dc:creator>
      <dc:date>2018-07-18T15:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: get data from selected features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-data-from-selected-features/m-p/850779#M3823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2018 16:23:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-data-from-selected-features/m-p/850779#M3823</guid>
      <dc:creator>TanyaMthet</dc:creator>
      <dc:date>2018-07-18T16:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: get data from selected features</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/get-data-from-selected-features/m-p/850780#M3824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You bet. Please let me know if you have any questions and I'll do my best to help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2018 16:53:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/get-data-from-selected-features/m-p/850780#M3824</guid>
      <dc:creator>deleted-user-qpvAI3Fo0MKR</dc:creator>
      <dc:date>2018-07-18T16:53:51Z</dc:date>
    </item>
  </channel>
</rss>

