Guest User

Untitled

a guest
May 27th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. import arcpy,os
  2. from arcpy import env
  3.  
  4. env.workspace = r"G:desktopProjectlyr"
  5. env.overwriteOutput = True
  6. for files in arcpy.ListFeatureClasses():
  7. filesPath = arcpy.Describe(files).catalogPath
  8. arcpy.MakeFeatureLayer_management( filesPath,"lyrName")
  9. arcpy.SaveToLayerFile_management("lyrName",os.path.splitext(filesPath)[0] + ".lyr")
  10.  
  11. import arcpy,os
  12. from arcpy import env
  13.  
  14. env.workspace = r"G:desktopProjectlyr"
  15. env.overwriteOutput = True
  16. radix = 0
  17. for files in arcpy.ListFeatureClasses():
  18. filesPath = arcpy.Describe(files).catalogPath
  19. lyrName = "layer{:d}".format(radix)
  20. arcpy.MakeFeatureLayer_management( filesPath,lyrName)
  21. arcpy.SaveToLayerFile_management(lyrName,os.path.splitext(filesPath)[0] + ".lyr")
Add Comment
Please, Sign In to add comment