# Name: createlayerfromselectedfeatures.py
# Description: creates a new layer based on a query.
# Author: RFurlong
import arcpy
from arcpy import env
arcpy.overwriteOutput = true
try:
# Make a layer from the feature class
arcpy.MakeFeatureLayer_management("C:/data/test.gdb/blockgroups_lyr")
# Write the selected features to a new layer
arcpy.CopyFeatures_management("blockgroups", "c:/data/test.gdb/blockgroups")