12

Is there a way to change symbology for multiple layers in ArcMap or ArcCatalog. I want to change the symbology of multiple layers at once.

7
  • 3
    You could make a really simple script tool using applySymbologyFromLayer. All you'd have to do is drag and drop the layers into the dialog box.
    – Roy
    Commented Oct 1, 2012 at 17:23
  • If you create a lyr file of multiple layers and drag it in (or add it from the add data button) it will apply all symbology, and labeling settings that are saved in the lyr. Note that you don't apply it to existing layers but bring them in again with this method.
    – Brad Nesom
    Commented Oct 1, 2012 at 19:39
  • @BradNesom- Thanks for the suggestion but I am specifically talking about altering the symbology of multiple layers that are already in the TOC. Basically applying a "Template" of symbology from one (existing) layer inthe TOC to many other (existing) layers in the TOC. Commented Oct 1, 2012 at 20:05
  • 2
    It baffles me why this functionality isn't built in to ArcMap...
    – jbaums
    Commented Jun 16, 2014 at 4:11
  • why not just merge all the layers into one, and then change the color of that one layer?
    – Robert
    Commented Apr 24, 2017 at 18:09

5 Answers 5

13

I had the same problem and I found another solution. It is simple and really practical, it doesn’t even need the creation of a *.lyr file.

In ArcGIS ModelBuilder editor box, I designed the below process:

  1. Create a variable, defining the data type to ‘layer’. In its properties set as “a list of values” and “Model parameter”. (Optional: Rename the object to “Layers to symbolize”, to an easier identification).
  2. Create a variable, defining the data type to ‘layer’. In its properties set as “Model parameter”. (Optional: Rename it to “Symbology Layer”).
  3. Add the Tool “Apply Symbology From Layer”, usually in ‘C:\Program Files\ArcGIS\Desktop10.2\ArcToolbox\Toolboxes\ Data Management Tools.tbx\Layers and Table Views’. (Optional: Rename the output object to “Symbolized Layers”).
  4. In Properties of the tool ‘Apply Symbology From Layer’ check as Preconditions: “Layers to symbolize” and “Symbology Layer”.
  5. Connect “Layers to symbolize” to the tool setting it as Input Layer.
  6. Connect “Symbology Layer” to the tool setting it as Input Layer.
  7. Save and close the model editor window.
  8. Opening the model, a table will appear.
  9. Drag the layer to be used as symbology's template, from the table of contents (TOC) of map project and drop it in the respective table field. Click ‘check values’ button.
  10. Select multiple layers of the TOC, drag and drop them to respective table field. Click ‘check values’ button.
  11. Run it.
  12. Click F5 to refresh the map display.

Notes: It will probably not work if you use at the same time layers of different types of geometries. It does not work well if you use at once layers with the same name. I did not tried with non vector layers.

Steps in the model builder.

Steps when running the model.

The exported script to python of the model is:

 # Import arcpy module
import arcpy

# Script arguments
Layers_to_symbolize = arcpy.GetParameterAsText(0)

Symbology_Layer = arcpy.GetParameterAsText(1)

# Local variables:
Symbolized_Layers = Layers_to_symbolize

# Process: Apply Symbology From Layer
arcpy.ApplySymbologyFromLayer_management(Layers_to_symbolize, Symbology_Layer)
3
  • 1
    At least for ArcGIS 10.2, step 6 should read "Connect “Symbology Layer” to the tool setting it as Symbology Layer"
    – jbaums
    Commented Jun 16, 2014 at 4:10
  • I had been using Python and made a nice for loop that ran fine, however it did not update my symbology. I did find that you need to first open the .mdx document, set the df, update the symbology, then change the symbology. I then saw answer 2, using Model Builder (which is how I originally built my Python script). This was WAY easier and less time intensive, plus I now have a tool saved so I can do this for other datasets. Commented Jul 31, 2015 at 15:39
  • 1
    Rather than put the 'Symbology from Layer' tool in Model Builder, you could just right click on it in the Toolbox and run as Batch Commented Feb 1, 2019 at 3:25
11

Edit You can use this script provided by ESRI to complete the task at hand (same idea as below):

import arcpy
arcpy.ApplySymbologyFromLayer_management("in_layer", "in_symbology_layer")

in_layer : The layer to which the symbology will be applied.
Feature Layer;Raster Layer; TIN Layer;Network Analysis Layer

in_symbology_layer : The symbology of this layer is applied to the Input Layer.
Feature Layer; Raster Layer;TIN Layer; Network Analysis Layer

Or extend this in the form of standalone scripting (think IDLE):

import arcpy
from arcpy import env

# Set the current workspace
env.workspace = "path/to/workspace"

# Set layer to apply symbology to
inputLayers = ["in_layer_first.lyr","in_layer_second.lyr","in_layer_third.lyr"]

# Set layer that output symbology will be based on
symbologyLayer = "in_symbology_layer.lyr"

# Apply the symbology from the symbology layer to the input layer
for layer in inputLayers:
    arcpy.ApplySymbologyFromLayer_management (layer, symbologyLayer)

In essence, you create a symbology layer (in_symbology_layer) that you maintain with respect to design/style. Then you copy that layers symbology on to each of your other layers as listed in your table of contents.


Previous Answer

You can use a style from a current layer in your table of contents/layer list and apply it to your other layers.

For each subsequent layer (below your intended style layer) > right click > properties > symbology > import style from other layer

2
  • Hi Michael,Thanks for the answer but I was looking to do it for multiple layers at once. Commented Jan 16, 2012 at 22:13
  • Ramakrishna, I have edited my answer with hopes that you find a better solution via arcpy. Commented Jan 17, 2012 at 6:09
8

Just prior to @Aaron s message, I used the information from @Roy to create my own solution that I could incorporate into am ArcToolbox script. See below:

# Import modules
import arcpy

#Get the current Map Document
mxd = arcpy.mapping.MapDocument("CURRENT")

# Script arguments
Template_Layer = arcpy.GetParameterAsText(0)
LayerList = arcpy.GetParameterAsText(1)
Layers_to_Symbolize = LayerList.split(";")

# Process: Apply Symbology From Layer
for UpdateLayer in Layers_to_Symbolize:
    arcpy.AddMessage("Updating: " + UpdateLayer)
    arcpy.ApplySymbologyFromLayer_management(UpdateLayer,Template_Layer)

# Refresh the Table of Contents to reflect the change
arcpy.RefreshTOC()

#Delete the MXD from memory
del mxd

I could see this concept as a potential tool for a 10.1 Python Add-in on the toolbar.

0
5

I've come up with a pretty simple way to enable multiple layer symbology all at once using the toolbox linked below. After you've added this toolbox, drag and drop the single symbology layer and then drag and drop all the layers you want to apply the symbology to (targets). General rules about matching geo-type (lines, points, polys) likely apply here. Once the tool has run, it will appear as nothing happened. Refresh your display (F5) - display will update with matching symbology. Click on a layer to view it's properties and click "OK" and the TOC symbol will update.

Download the Zip file for the toolbox here.

Here's the script if that is easier:

import arcpy

# Script arguments
Target_Layers = arcpy.GetParameterAsText(0)
if Target_Layers == '#' or not Target_Layers:
Target_Layers = "LayersToBeChanged" # provide a default value if unspecified

Symbology_Layer = arcpy.GetParameterAsText(1)
if Symbology_Layer == '#' or not Symbology_Layer:
Symbology_Layer = "SymbologyLayer" # provide a default value if unspecified

# Local variables:
Output_Symbology = Symbology_Layer

# Process: Apply Symbology From Layer (3)
arcpy.ApplySymbologyFromLayer_management(Target_Layers, Symbology_Layer)
3

Updated @ Pro

How To: Apply the same symbology to multiple rasters [or vector layers!] in ArcGIS Pro

See the link above and the resources below for more details.

  1. Find or search the Geoprocessing Toolbox for the Apply Symbology From Layer tool
  2. Right-click and select Batch
  3. Select Input Layer as the batch parameter and apply the batch options as needed

(Recommend leaving Add output datasets to an open map selected; seems counterintuitive to me but deselecting this option deleted all my batch-symbolized layers from the map)

  1. Drag and drop multiple layers into the Batch Input Layer drop-down list
  2. Select the layer with the source symbology in (or drag and drop into) the Symbology Layer drop-down list
  3. Consider your options at the Update Symbology Ranges Data drop-down list (I used Default for my vector layers; the raster example linked above suggests otherwise)
  4. Run!

Other resources:

Apply Symbology From Layer (Data Management)

Batch Geoprocessing

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