Need to get to the Layout Legend objects, such as swatches and label properties.

4059
2
01-13-2015 02:24 AM
MiguelParedes
Esri Contributor

Greetings List.  I would like to be able to access the legend elements on a layout document in order to check the dimensions of the swatches and the font, font size, style, and similar properties of the legend elements.  Does anyone know if this is possible through Arcpy.mapping?

I have looked at ListLayoutElements, with LEGEND_ELEMENT as the element_type, but that only returns a list of the names of the layers in the legend.

I have a feeling that the object model for Arcpy.mapping is not granular enough to obtain the information I need.  Is this correct?

Any help, suggestions, advice would be greatly and gratefully appreciated.

Miguel
Tags (2)
0 Kudos
2 Replies
PhilippeRieffel1
Occasional Contributor

Hey Miguel,

just by looking at the documentation it seems possible to me. Did you try to dive deeper into the elements in the returned list?

Best,

Philippe

0 Kudos
DavidBlanchard
Esri Contributor

The documentation does seem to support this, there are no objects for each individual legend item, but just a name.

You could try to parse the XML's that are created when exporting an MXD to an MSD as documented in this post:

arcgis desktop - Creating summary table of symbology of all datasets in multiple MXDs? - Geographic ...

0 Kudos