arcpy.mapping.UpdateLayer doesn't bring in labeling

284
1
07-22-2012 01:47 PM
GIS1
by
New Contributor II
Hi friends,

It's me again 🙂

I am having some difficulty getting arcpy.mapping.UpdateLayer to actually bring in labeling. It brings in everything else fine from the reference layer (legend colours etc...) except once it is in my map, the layer does not have the necessary labeling. If I go in and check the checkbox and fill in the expression myself, it works fine. Of course, when I open the reference .lyr file itself, it does indeed have the checkbox ticked and the expression is present.

Anyone know why this happens?

I've tried using the following bits of code as well, but they do nothing either 😞


    
if landtypelayer.supports("LABELCLASSES"):
        arcpy.AddMessage("supports labelclass!")
        landtypelayer.showLabels = True
        for lblclass in landtypelayer.labelClasses:
            arcpy.AddMessage("in labelclass forloooooooooooooop!")
            lblclass.className = "Land Types"
            lblclass.expression = "[GLM_CODE] & vbnewline & [GLM_PC]"
            lblclass.showClassLabels = True


Any ideas?

Thanks!
Tags (2)
0 Kudos
1 Reply
JeffBarrette
Esri Regular Contributor
I can not reproduce this.  Could you please provide more information about the update layer and source layer as well as the script that includes the UpdateLayer function.

Thanks,
Jeff
0 Kudos