2

I'm searching for a way to update layer symbology. I have around 50 mxd which have all the same TOC made of 2 dataframes (one .lyr for each) containing numerous layers / layer groups. The data is essentially shapefiles, most of them are in different folder/disks. The file organization technique is something that I would do differently if it was my data, but I have to deal with it as it is.

I don't wan't to import the .lyr files and delete the old content in each of the maps, because I would have to re-do the legend each time (and I don't want to convert the legend to graphics for obvious reasons...).

So, does anyone know a script or anything else that could help me to link or apply a .lyr symbology to a bunch layers/layer groups in multiple mxd?

4
  • 1
    You say you don't want to import lyr files because you do not want to redo the legend but then ask how to apply a lyr symbology which would obviously change the symbology and thus the legend. It's not clear what you are asking for?
    – Hornbydd
    Commented Apr 4, 2016 at 16:51
  • The story of my life: not being clear. Take 2: Forget about the legend stuff. How to simply update 2 datasets with 2 lyr files in one mxd? Update, not replace. And how to apply that to multiple mxd. Is it clearer?
    – Rashomon
    Commented Apr 4, 2016 at 16:52
  • Sounds like you want to be using the Apply Symbology From Layer tool?
    – Hornbydd
    Commented Apr 4, 2016 at 17:15
  • Maybe, but I'm not sure it will do the trick. I can't name each of the layer un a code, it will take way too long. I saw this response on another thread: gis.stackexchange.com/a/80981/69986. His way seems fine, I'll give it a try. Would you know how to use the glob.glob function mentionned in the comments to loop the code to every mxd in a file?
    – Rashomon
    Commented Apr 5, 2016 at 20:30

1 Answer 1

1

You say that you "would have to re-do the legend each time" but this is not the case if you have the Legend Properties set to Add a new item to the legend when a new layer is added to the map.

enter image description here

The other options on this General tab of the Legend Properties are also worth becoming familiar with for workflows like the one that you are attempting.

For more control over your layers/legend than this you would need to use arcpy.mapping.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.