So the ApplySymbologyFromLayer_management() tool doesn't seem to like me, at least when I try to use it in a script. I have a Field_Boundary2.lyr file that has a "hollow" fill color and a black outline for a polygon boundary. In ArcMap, when I import this layer's symbology onto another layer, it looks like this:
But if I try to use it with arcpy.ApplySymbologyFromLayer() in a script, it gives me this:
Here's the code:
df = arcpy.mapping.ListDataFrames(mxd,"dfElevation")[0]
fc1 = arcpy.mapping.Layer(fcGrid)
arcpy.ApplySymbologyFromLayer_management(fc1, arcpy.mapping.Layer(symbologyTemplatePath + "Elevation.lyr"))
arcpy.mapping.AddLayer(df,fc1,"BOTTOM")
fc2 = arcpy.mapping.Layer(fcBound)
arcpy.ApplySymbologyFromLayer_management(fc1, arcpy.mapping.Layer(symbologyTemplatePath + "Field_Boundary2.lyr"))
arcpy.mapping.AddLayer(df,fc2,"TOP")
From the picture above you can see that the "Elevation.lyr" symbology is being imported correctly, but not the "Field_Boundary2.lyr". Any idea why this might be happening?
mxd.save()
fc1
should befc2
in line 6?