Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import arcpy,os
- from arcpy import env
- env.workspace = r"G:desktopProjectlyr"
- env.overwriteOutput = True
- for files in arcpy.ListFeatureClasses():
- filesPath = arcpy.Describe(files).catalogPath
- arcpy.MakeFeatureLayer_management( filesPath,"lyrName")
- arcpy.SaveToLayerFile_management("lyrName",os.path.splitext(filesPath)[0] + ".lyr")
- import arcpy,os
- from arcpy import env
- env.workspace = r"G:desktopProjectlyr"
- env.overwriteOutput = True
- radix = 0
- for files in arcpy.ListFeatureClasses():
- filesPath = arcpy.Describe(files).catalogPath
- lyrName = "layer{:d}".format(radix)
- arcpy.MakeFeatureLayer_management( filesPath,lyrName)
- arcpy.SaveToLayerFile_management(lyrName,os.path.splitext(filesPath)[0] + ".lyr")
Add Comment
Please, Sign In to add comment