天天看点

Arcmap批量统一修改多图层样式

Arcmap批量统一修改多图层样式

  1. 打开arcmap-python控制台
    Arcmap批量统一修改多图层样式
  2. 设置好某一图层样式(例如图层名称:123)
  3. 在python控制台中输入一下代码
originLayerName = "123"   #这里填入设置好的图层样式名称
mxd = arcpy.mapping.MapDocument(r"CURRENT")
originLayer = arcpy.mapping.ListLayers(mxd, originLayerName)[0]
layers = arcpy.mapping.ListLayers(mxd)
for lyr in layers:
    if lyr.name == originLayer.name: 
        continue
    if (originLayer.isFeatureLayer and lyr.isFeatureLayer) or (originLayer.isRasterLayer and lyr.isRasterLayer):
        arcpy.ApplySymbologyFromLayer_management(in_layer=lyr, in_symbology_layer=originLayer)
           
  1. 回车等着运行就好啦~