AnsweredAssumed Answered

how can we set Label scale and placement property using arcpy?

Question asked by manjarigoyal on Sep 27, 2016
Latest reply on Sep 28, 2016 by manjarigoyal

Below is the code and what I am trying to do is set the scale range on Label minScale = 500000; and label placement should be top center only. I am sure how to automate this through arcpy. 

 

arcpy.MakeFeatureLayer_management(FC7, r"C:\Users\Documents\Search_Ring.lyr")
layer7 = arcpy.mapping.Layer(r"C:\Users\DocumentsSearch_Ring.lyr")
Sym_layer7 = r"C:\Users\Documents\Symbology layer new\Search Ring.lyr"
arcpy.ApplySymbologyFromLayer_management (layer7, Sym_layer7)
arcpy.mapping.AddLayer(df, layer7, "AUTO_ARRANGE")
lyr7 = arcpy.mapping.ListLayers(mxd, "", df)[0]
lyr7.labelClasses[0].expression = '"{}" + [Candidate_Code] + "{}"'.format("<CLR blue='255'><FNT size = '9'><BOL>", "</BOL></FNT></CLR>")
lyr7.showLabels = True
lyr7.visible = False
lyr7.name = "Search_Ring"
lyr7.maxScale = 0;
lyr7.minScale = 25000000;
lyr7.transparency = 25;

Outcomes