Is it possible to get the attribute values from selected features and export them to an excel file using python? If so, how do i go about it.
Thank You
If I understand you correctly, you're wanting to create a selection, and then export the results to .xls.
Here's how I would do it:
# Import libary
import arcpy
from arcpy import env
# Set variables
yourworkspace = "path to your workspace"
yourfeatureclass = "path to your feature class"
outputlocation = "path to your output folder"
arcpy.env.workspace = yourworkspace
# Make Layer
arcpy.MakeFeatureLayer_management (yourfeatureclass, "featureclasslayer")
# Create selection
arcpy.SelectLayerByAttribute_management ("featureclasslayer", "NEW_SELECTION" ["build your selection criteria here"])
# Copy the results of your selection to a new feature class
arcpy.CopyFeatures_management ("featureclasslayer", "yourselectedfeatures")
# Export to Excel
TableToExcel_conversion ("yourselectedfeatures", "yourexcefilename.xls")
# Finish
raise SystemExit(0)
Thank you
You bet. Please let me know if you have any questions and I'll do my best to help.