Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

UpdateLayer not copying the labels

$
0
0
Using UpdateLayer or ApplySymbologyFromLayer_management copies the symbology but not the labels. When I tried to use UpdateLayer with a third argument of False I get an insertion error, so I am not sure why doesn't work. Do you guys have any idea why? Thanks

Code:

outputlyr = arcpy.mapping.Layer("D:/ArcGISData/SARS/Temp/ClpSoilsSort.shp")
        arcpy.mapping.AddLayer(df2, outputlyr, "AUTO_ARRANGE")
        arcpy.mapping.MapDocument('CURRENT').activeView = "Overview"
   
        symbologylayer = arcpy.mapping.Layer("D:/ArcGISData/SARS/Temp/SoilsUpdateLayer2.lyr")
        arcpy.ApplySymbologyFromLayer_management (outputlyr, symbologylayer)
        #arcpy.mapping.UpdateLayer(df, outputlyr, symbologylayer)

        arcpy.mapping.AddLayer(df, outputlyr, "AUTO_ARRANGE")
        arcpy.mapping.AddLayer(df2, outputlyr, "AUTO_ARRANGE")
        arcpy.RefreshActiveView()


Viewing all articles
Browse latest Browse all 2485

Trending Articles