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.
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.