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!

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

  1. Jaspar
    October 31, 2014 at 8:25 am

    Just downloaded this…I’ve been trying to find the solution to the exact same problem. Thank You.

    1. Ian
      December 8, 2014 at 10:39 pm

      Cool, hope it helps!

  2. pabsdoe
    April 14, 2015 at 4:58 am

    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

  3. pabsdoe
    April 15, 2015 at 4:44 am

    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”)

    1. Ian
      April 15, 2015 at 10:52 am

      Awesome! Nice job figuring it out, and letting me know. I’m sure someone else will find this very useful!

  4. Chu Quang Thao
    July 6, 2015 at 7:12 pm

    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).

  5. Vince
    September 23, 2015 at 6:05 am

    Ian, I just wanted to let you know that I use your Update Layer Properties tool OFTEN. It is so much better than the default layer update capabilities. Nicely done!

    1. Ian
      January 17, 2017 at 8:59 pm

      That awesome to hear! Thanks for the comment.

  6. Ravi Singh
    October 25, 2015 at 2:48 pm

    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?

    1. Ian
      November 3, 2015 at 6:09 pm

      Hi Ravi- sorry, but this tool applies the properties to the entire layer – not individual features.

  7. November 5, 2016 at 5:57 pm

    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!

    1. Ian
      November 6, 2016 at 9:21 pm

      Hi Jim, thanks for the comment. To add the toolbox, you need to be in ArcMap and open ArcToolbox. Right click in the whitespace of ArcToolbox and click Add Toolbox … then browse to the toolbox you downloaded here, and click Open.

      Here’s a video of a different toolset that shows the process:
      https://www.youtube.com/watch?v=ZBU4-TUm3HQ

Leave a Reply

Your email address will not be published.