I have some ArcMap addin that creates new layer and add it into table of content. I need to set up labels for that layer.

I have made some script for labeling layer:

mxd = arcpy.mapping.MapDocument("CURRENT")
data_frame = mxd.activeDataFrame

layer_divide = arcpy.mapping.ListLayers(mxd, "layer", data_frame)[0]
if layer_divide.supports("LABELCLASSES"):
    for lblclass in layer_divide.labelClasses:
        lblclass.expression = "[OBJECTID]"
        lblclass.showClassLabels = True

layer_divide.showLabels = True

This add labels, but I don't know how to change font size of that labels.

1 Answer 1


Labels in ArcMap can have formatting codes within the expression, so something like:

lblclass.expression = '"{}" + [OBJECTID] +  "{}"'.format("<FNT size = '24'>","</FNT>") 

might work for you. This is adding font tags around your ObjectID into a label expression <FNT size = '24'> + OBJECTID + </FNT>

  • Thank you! That expression worked for font size. What about layer symbology? Don't you know hot to set it?
    – david_p
    Commented Feb 2, 2016 at 8:59
  • 1
    Sorry I didn't see you had two questions - please ask this as a separate question.
    – Midavalo
    Commented Feb 2, 2016 at 17:46
  • OK, I ask new question here: gis.stackexchange.com/questions/179139/…
    – david_p
    Commented Feb 2, 2016 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.