AnsweredAssumed Answered

Bug with arcpy.mapping.UpdateLayer() method ??

Question asked by tcrack326 on Jul 22, 2013
Latest reply on Jul 23, 2013 by tcrack326
Greetings and Salutations Python Masters of the Universe,

I believe I have a minor bug here with the arcpy.mapping.UpdateLayer() method.  If anyone can help me correct it or work around it I would greatly appreciate it.

I'm not going to post the code because it is a simple script.  Basically I use the UpdateLayer method to update a whole bunch of layers, about 150, and the 'update symbology only' is set to False.  I'm updating everything; each layer comes from a different feature class for different counties so the database schema is the same for each.  I use the UpdateLayer to hide fields on all the layers.

So, after updating, the name for each layer is now based on the original layer that I used as the Source Layer.  Well, this is where the fun part comes in, whenever I go to change any of the names they all change based on whatever the one has been changed to. If I go to one of the layer's properties and change the name, it then changes the name of every single layer.  I've copied all the layers into another data frame to copy so I can loop through and set the names to be equal but it won't work because of this bug.

Again, the layer name changes for every layer when only one has been changed after using the UpdateLayer method on the layers.

Thanks,

GIS Python Padewan

Outcomes