ListLayoutElements always returns a Python list object even if only one page element is returned. In order to return an element object, an index value must be used on the list (e.g., elm = arcpy.mapping.ListLayoutElements(mxd)[0]).
Thanks everyone.I have an additional question, but not related terms.For the code in this script it renames a legend element on the map. My question is what purpose does the [0] serve in making the code work/ what purpose does it serve? Please see image below for a clear picture of the issue. [ATTACH=CONFIG]14995[/ATTACH]
*ahem* from the help *ahem*[0] means the first in the list (ie. an individual Layout Element object). If you leave it off, it returns a list of Layout Elements.
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.