Select to view content in your preferred language

Symbology Rendering Question - Color Outline to Null

422
2
09-28-2022 03:16 PM
tzz_12
by
New Contributor III

Hi Everyone, 

I am hoping ESRI staff will also respond to this post. Is there a bug in the arcpy symbology rendering or is this a syntax issue? I am trying to change the outline of my symbology rendering output to no color but I can't seem to change the outline color, only the point symbol color changes. Does anyone else have the same issue? Please see my script below. I know the last number is for opacity, which is the opposite of Transparency, but it doesn't seem to make a difference when I change the opacity number, because the outline color remains black...Thanks for your help!

#Add spatial join layer to the current map
p = arcpy.mp.ArcGISProject('CURRENT')
m = p.listMaps('map')[0]
layer = Comp.getOutput(0)
m.addDataFromPath(layer)

#Format symbology rendering 
l = m.listLayers(Comp_Name)[0]
sym = l.symbology

if sym.renderer.type == 'SimpleRenderer':
    sym.updateRenderer('GraduatedColorsRenderer')
    sym.renderer.classificationField = Comp_Field
    sym.renderer.classificationMethod = 'NaturalBreaks'
    sym.renderer.breakCount = 7

#Updating Symbology Rendering        
for brk in sym.renderer.classBreaks:
    brk.symbol.size = 6
    brk.symbol.outlineColor = {'RGB' : [0, 0, 0, 0]} 
#Show symbology updates
l.symbology = sym
Tags (2)
0 Kudos
2 Replies
by Anonymous User
Not applicable

What version of Pro/arcpy do you using? 

And it helps if you format your code by clicking the ..., then clicking the </> icon.  Paste your code into the window and select python.

0 Kudos
tzz_12
by
New Contributor III

Hi Jeff, 

Thanks for showing me how to add the code in the python window. I am using ArcGIS Pro 2.8. @Anonymous User 

 

0 Kudos