Select to view content in your preferred language

Label expressions for callout options

957
3
12-13-2022 07:44 AM
Status: Open
Labels (1)
piratecheese
Occasional Contributor

I'm starting to experiment with label expressions in Pro.  I was able to create the a label class using expressions to have the barcode font and normal font below it inside the same label. 

My boss was impressed and now wants to know if I can make the callout boarder and lead-line conditional. The feature.field that want feeding the conditional statement is a text domain with T(ee),F(airway),G(reen),R(ough) or B(unker). 

I'm looking for something along the lines of

IIF(feature.field = t, <CALLOUT> backgroundOutlineColor = [RGB dark green] +  leaderLineColor = [RGB dark green]</CALLOUT>, [nested IIF() for feature.field= f,g,s and b]

Final clarification, I'm looking for an expression that controls the options below. 

piratecheese_1-1670945876725.png

 

I've been told that using a popup, with HTML is an end around. This didn't work for me, as they need to be persistent in layouts and need to label engine to avoid overlaps.

3 Comments
jcarlson

I would just duplicate the label class and apply filters on each, then make the changes. So instead of trying to have one label class with multiple "styles" based on attributes, just have multiple label classes based on those attributes.

wayfaringrob

@jcarlson  that's an OK workaround in theory, but in practice it's a pain to go chase down several label classes and manually edit whatever you need to edit over and over again.

jcarlson

@wayfaringrob Yeah, label classes are meant to be entirely different. Trying to keep a unified subset of attributes across multiple classes is very tedious, but there's not really a way to accomplish this kind of thing until we can use attribute-based overrides in more places.

Until that happens, you could devise an ArcPy script that defines the subset of things (font, size, etc) you want consistent across classes, which then applies to all the label classes. Then you only have to adjust things in one place. Not perfect, but it may be the only non-tedious approach for now.