Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import arcpy
- arcpy.env.workspace = "path"
- arcpy.env.overwriteOutput = True
- allfeatures = arcpy.ListFeatureClasses()
- print allfeatures
- for feature in allfeatures:
- desc = arcpy.Describe(feature)
- shape = desc.shapeType
- if shape == "Point":
- name = feature[:-4]
- lyrname = name +"_lyr"
- arcpy.MakeFeatureLayer_management(feature, lyrname)
- outputlyr = lyrname + ".lyr"
- lyr=arcpy.SaveToLayerFile_management(lyrname, outputlyr)
- outputkmz = name + ".kmz"
- arcpy.LayerToKML_conversion(lyr,outputkmz)
- import arcpy
- mxd = arcpy.mapping.MapDocument("path")
- layers = arcpy.mapping.ListLayers(mxd)
- for layer in layers:
- print layer.name
- if layer.supports("LABELCLASSES"):
- print "yeeeah"
- #layer.labelClasses
- for lblclass in layer.labelClasses:
- lblclass.expression = "[ORIG_FID]"
- layer.showLabels = True
- #lblclass.showClassLabels
- layer.showLabels = True
- mxd.saveACopy("path")
Add Comment
Please, Sign In to add comment