I have some substances TPH, CO2, SO2, VOC, analyzed in a period of time 2001 - 2017. In the .mxd each year is a group layer, containing all the substances for that year:
2001: - TPH
- CO2
- SO2
- VOC
2002 - TPH
- CO2
- SO2
- VOC
...until 2017
I want to apply the same symbology for TPH substance in 2001, 2002, 2003 etc. I have made .lyr files for all the substances, but I have managed to write a functional code to apply one symbology for all layers in the same group layer.
Any solution to apply the same symbology for just one layer in all the group layers?
I have many more substances than the ones mentioned!
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = mxd.activeDataFrame
groupName = "2001"
allLayers = arcpy.mapping.ListLayers(mxd, groupName, df) [0]
for layer in allLayers:
arcpy.ApplySymbologyFromLayer_management(layer, "TPH")
PS: I use ArcMap 10.6 and the batch function for the Apply Symbology From Layer tool is not working