1

This question already has an answer here:

I'm using ArcMap 10.4.1.

I am trying to update a point layer symbology with a premade lyr file, then adjusting it's class break values in arcpy. It's working fine, only it changes the symbols back to default (while the colours stay correct). I don't want my points to have a stoke/outline and can't change that with arcpy, so thats a problem.

Here's my code:

updateLayer = arcpy.mapping.ListLayers(mxd, "FC", df)[0]
FClyrpath = "FCsymology.lyr"
sourceLayer = arcpy.mapping.Layer(FClyrpath)
arcpy.mapping.UpdateLayer(df,updateLayer,sourceLayer, symbology_only = True)

lyr = arcpy.mapping.ListLayers(mxd, "FC", df)[0]

if lyr.symbologyType == "GRADUATED_COLORS":
    lyr.symbology.valueField = "depth"
    lyr.symbology.classBreakValues = [3, 5, 8, 11, 12, 15, 18, 21, 24, 72]

arcpy.RefreshTOC()

This is what my premade ".lyr" symbology looks like:

lyr

This is what happens when changing the classbreakValues: The classification is good, the strokes around the symbol not.

after

I also tried changing the default symbology in AdvancedArcMapSettings, but no avail.

marked as duplicate by PolyGeo arcpy Dec 21 '16 at 7:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

I had the same problem with some polygon layers and found that it is an ESRI-related bug. See this link for more details on it.

  • In a case like this it is probably best to raise a flag and suggest that this is a duplicate of the other question. – PolyGeo Dec 21 '16 at 8:01
  • Thanks a lot! I had been stuggeling with this for a long time! – Silke Jan 19 '17 at 20:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.