ArcGIS Toolbox – Using a Layer File to Update Layer Properties

Share Button

(If you’re using Firefox, then right click and Save Link As)
Download the Update Layer Properties Toolbox
View the Source Code

(any donations go towards hosting costs)

The Update Layer Properties tool updates a layer’s symbology, labels, field aliases, selection symbology, definition queries, etc – based on an existing input layer file. So, simply put, any setting within the Layer File properties will be updated.

Normally, when you update a layer’s properties within ArcMap with a layer file, it re-sources the layer to the same data source as the layer file. I’ve made it so that after the properties are loaded from the layer file, the layer in ArcMap re-sources back to its original data source.

For an example, say you have Layer A, Layer B, and Layer C which have the same underlying schema, but different data. You set all the layer properties for Layer A (symbology, label classes, definition query, transparency, etc) and save it as a layer file.

Now, you want to apply all these properties to Layer B and Layer C without setting them manually. This tool allows you to do that while keeping the original data source, which is the main point of the tool. Because as previously mentioned, when you use the arcpy.mapping.UpdateLayer() it re-sources the layer back to the data source the layer file was originally created from.

This is the GIS Stackexchange question which led to me creating this tool.

Here’s a screenshot of the parameters:Update Layer Properties parameters

I hope someone finds this tool useful. Please leave a comment if you have any questions or problems, and be sure to check out the other tools I’ve created!

15 thoughts on “ArcGIS Toolbox – Using a Layer File to Update Layer Properties

  1. Hi man tnx much, your tool is what i am looking for. Is there a way that i can use ur script as python file, because i am planning to automate everything without using the toolbox but implemented in the python file already. I am still trying to recode it but no luck… hehe tnx much

  2. man i got your toolbox working and i am very grateful to you.
    this is what i did

    arcpy.ImportToolbox(“C:\GIS\UpdateLayerProperties.tbx”)

    arcpy.UpdateLayerProperties.UpdateLayerProperties(“tempLayer”,”C:/label.lyr”)

  3. Hi Ian, I run this tool & get this Error:
    Traceback (most recent call last):
    ” File “D:\ArcGIS Tools\UpdateLayerProperties.tbx#UpdateLayerProperties_UpdateLayerProperties.py”, line 20, in
    UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 0-2: ordinal not in range(128)
    Failed to execute (UpdateLayerProperties). ”
    Problem with the codec in the feature class’s attribute? My database using Unicode for Vietnamese (UTF-8).

  4. Thanks for this tool, it is really helping me with my work which involves printing maps every now and then.

    Just one question, I am not able to apply this tools to selected features only or selection layer. It applies to the whole layer again.Is there any solution for that?

  5. I have 10.3 and really need to reuse all the symbols, fonts, labels, etc of a few layers that I continually update from new data. I can’t figure out how to install/use this tool. Can you please post the steps to use? Thanx for the contribution!

Leave a Reply