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.
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.
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
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:
- 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).
- Create a variable, defining the data type to ‘layer’. In its properties set as “Model parameter”. (Optional: Rename it to “Symbology Layer”).
- 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”).
- In Properties of the tool ‘Apply Symbology From Layer’ check as Preconditions: “Layers to symbolize” and “Symbology Layer”.
- Connect “Layers to symbolize” to the tool setting it as Input Layer.
- Connect “Symbology Layer” to the tool setting it as Input Layer.
- Save and close the model editor window.
- Opening the model, a table will appear.
- 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.
- Select multiple layers of the TOC, drag and drop them to respective table field. Click ‘check values’ button.
- Run it.
- 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.
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)
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.
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.
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)
There is a similar post on GISse with a programmatic solution here.
Also, ArcGIS help 10.1 has some great information on combining categories and organizing categories into groups