Global Replace Color

57
4
06-23-2020 02:06 PM
Highlighted
by
Occasional Contributor II

Is there a tool in Pro or a script that I can run that would search all layers (multipatches) in my project and replace one color for another? It would just be swapping out one set of RGB values (or Hex) for another set.

The feature class layers in my project each have their own unique symbology so a batch “Apply Symbology from Layer” won’t work

Thanks!

Reply
0 Kudos
4 Replies
Highlighted
Esri Frequent Contributor

Brian - if the color is part of the attribute table for your multipatch feature class, then this thread towards the bottom shows how to Vary symbology by attribute using an attribute field.  The key is getting the original RGB (or Hex) for the feature class in the attribute first, then calc'ing a new field with the new RGB (or Hex).

Reply
0 Kudos
Highlighted
by
Occasional Contributor II

It is not in the attribute table. The layer is colored through Symbology

Highlighted
Esri Notable Contributor

You should be able to do this using arpy.mp to iterate through layers and then CIM access to set symbology.

Check out Example 3:Python CIM access—ArcPy | Documentation 

Reply
0 Kudos
Highlighted
by
Occasional Contributor II

Thanks Kory. I was pretty sure ArcPy could do this. Unfortunately, I'm not a coder so was hoping someone had something they had written already as a starting point.

I'll look it some more though.