From e8d04ada0576213b7e6193c4dabf2657fff966f9 Mon Sep 17 00:00:00 2001 From: Thomas Fuhrmann Date: Mon, 9 Dec 2024 11:11:49 +0100 Subject: [PATCH] Add default outlines if not set; Put outlines on top of symbol layers --- FeatureRenderer.pyt | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/FeatureRenderer.pyt b/FeatureRenderer.pyt index 2a6f0e9..cdde665 100644 --- a/FeatureRenderer.pyt +++ b/FeatureRenderer.pyt @@ -4,12 +4,13 @@ import arcpy # type: ignore DEFAULT_LINE_WIDTH = 0.7 DEFAULT_COLOR = [ - 59.61, - 50.98, - 50.59, - 19.61, + 0, + 0, + 0, + 57, 100, ] +CODE_BLK = "BLK" class Toolbox: @@ -432,7 +433,14 @@ class FeatureRenderer: if leg_id in outline_codes: # Set user defined outline color outline_code = outline_codes[leg_id] + + if ( + not outline_code + ) or outline_code == "#": + outline_code = CODE_BLK + color_value = get_symbol_color(outline_code) + color = ( arcpy.cim.CreateCIMObjectFromClassName( "CIMCMYKColor", "V3" @@ -477,6 +485,10 @@ class FeatureRenderer: if leg_id in outline_codes: # Set user defined outline color outline_code = outline_codes[leg_id] + + if (not outline_code) or outline_code == "#": + outline_code = CODE_BLK + color_value = get_symbol_color(outline_code) color = arcpy.cim.CreateCIMObjectFromClassName( "CIMCMYKColor", "V3" @@ -572,8 +584,10 @@ class FeatureRenderer: stroke_symbol.width = stroke_symbol_props[ leg_id ]["width"] - unique_value_class.symbol.symbol.symbolLayers.append( - stroke_symbol + + # Insert at the beginning such that it appears on top of solid fill layer + unique_value_class.symbol.symbol.symbolLayers.insert( + 0, stroke_symbol ) # Regroup items