Add message if leg id was not found in legend table

This commit is contained in:
Fuhrmann 2024-12-09 10:35:47 +01:00
parent 18f5ca5aa5
commit 530c3a6823

View file

@ -3,6 +3,13 @@
import arcpy # type: ignore
DEFAULT_LINE_WIDTH = 0.7
DEFAULT_COLOR = [
59.61,
50.98,
50.59,
19.61,
100,
]
class Toolbox:
@ -380,6 +387,10 @@ class FeatureRenderer:
messages.AddMessage(
f"Could not find symbol in gallery {symbol_key}"
)
else:
messages.AddMessage(
f"{leg_id} is not in legend table yet"
)
# Add user defined labels
if add_labels:
@ -440,7 +451,7 @@ class FeatureRenderer:
color = arcpy.cim.CreateCIMObjectFromClassName(
"CIMCMYKColor", "V3"
)
color.values = [40, 40, 40, 10, 100]
color.values = DEFAULT_COLOR
stroke_symbol_props[leg_id][
"color"
] = color
@ -477,7 +488,7 @@ class FeatureRenderer:
color = arcpy.cim.CreateCIMObjectFromClassName(
"CIMCMYKColor", "V3"
)
color.values = [40, 40, 40, 10, 100]
color.values = DEFAULT_COLOR
stroke_symbol_props[leg_id]["color"] = color
if not stroke_symbol_props[leg_id]["width"]: