AnsweredAssumed Answered

How do I apply a style file to a field in a feature layer?

Question asked by Holywhippet on Sep 4, 2014
Latest reply on Sep 4, 2014 by ncelik

I've got a style file which I'm trying to apply to a feature class and create a .lyr file from it. There are multiple fields in the feature class which the style can be applied to. I just can't quite work out how to do this using python though.

 

Most example like the one on this page: ArcGIS Help 10.1  mentions using legend = arcpy.mapping.ListLayoutElements(mxd, "LEGEND_ELEMENT")[0] then using that object to modify the layer. But when I try that it doesn't find any legend elements. Even if it did, none of the examples mention how to apply it to a specific field.

 

I also tried using an existing .lyr file with the same style applied then using ApplySymbologyFromLayer to copy it over. That works, but I can't modify the symbology to change the field it has been applied to.

 

 

Outcomes