I've created hatch marks on a line to use as stationing for a levee feature on a map but I need to format the labels to read like stations rather than just numbers. I'm able to do this in ArcMap (see attached screenshot) using the following expression:
def FindLabel (esri__measure):
EM = str(int(round(esri__measure)))
if len(EM) == 0:
return "0+00"
elif len(EM) == 1:
return "0+0{0}".format(*EM)
elif len(EM) == 2:
return "0+{0}{1}".format(*EM)
elif len(EM) == 3:
return "{0}+{1}{2}".format(*EM)
elif len(EM) == 4:
return "{0}{1}+{2}{3}".format(*EM)
elif len(EM) == 5:
return "{0}{1}{2}+{3}{4}".format(*EM)
elif len(EM) == 6:
return "{0}{1}{2}{3}+{4}{5}".format(*EM)
Now I have to do the same thing but in ArcPro and I'm only given the option to do this using Arcade. Does anybody know how I can convert the expression/script above from Python to Arcade? I'm a novice at both languages so any help would be much appreciated!
Label class properties in Pro should let you pick Python to use the existing code.
R_
Thanks for replying but that is not the window I see when I label the hatch marks.
My team lead showed me this post that solved my problem.
Now that I've figured this out, does anybody know how I would convert these to annotation? Now that the levee station numbers have been generated, I can't figure out how to rotate them into place. I'd like to convert the numbers to annotation but I can't find how to do that since the station numbers are not true labels since they are not based on attribute table values.