Select to view content in your preferred language

ListStyleItems function is missing from mapping

2565
2
Jump to solution
06-06-2014 02:55 AM
WillemMaetens1
Deactivated User
I'm trying to apply a legend style from a .style file to an existing legend in my map document.
When calling the ListStyleItems function to select the .style file (as per: http://resources.arcgis.com/en/help/main/10.2/index.html#//00s300000074000000) however, an error is produced:

import arcpy arcpy.mapping.ListStyleItems("USER_STYLE", "Legend Items")


produces the error:

Runtime error <type 'exceptions.AttributeError'>: 'module' object has no attribute 'ListStyleItems'

also, when typing in the ArcMap python window, the ListStyleItems function does not show up in de function dropdown box:
[ATTACH=CONFIG]34404[/ATTACH]

So, where's the function gone? or is there a workaround to script legend styles? Specifically, I want to set the Show Layer name, Show Layer labels, etc. properties of the legend.

I'm using ArcMap 10.0 Desktop which runs on a server through a Citrix Client.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RichardFairhurst
MVP Alum
I'm trying to apply a legend style from a .style file to an existing legend in my map document.
When calling the ListStyleItems function to select the .style file (as per: http://resources.arcgis.com/en/help/main/10.2/index.html#//00s300000074000000) however, an error is produced:

import arcpy arcpy.mapping.ListStyleItems("USER_STYLE", "Legend Items")


produces the error:

Runtime error <type 'exceptions.AttributeError'>: 'module' object has no attribute 'ListStyleItems'

also, when typing in the ArcMap python window, the ListStyleItems function does not show up in de function dropdown box:
[ATTACH=CONFIG]34404[/ATTACH]

So, where's the function gone? or is there a workaround to script legend styles? Specifically, I want to set the Show Layer name, Show Layer labels, etc. properties of the legend.

I'm using ArcMap 10.0 Desktop which runs on a server through a Citrix Client.


The help you referenced only applies to version 10.1 or higher per the what's new at 10.1 documentation.  As far as I know, there is no way to access it at 10.0 and upgrading is the only option.  You might be able to call it using an ArcObjects module somehow, but you would have to get someone else to help you with that.  Given that an upgrade will work much more robustly and you would be repeating the work the ESRI programmer's have done much better, I would push for the upgrade.

View solution in original post

0 Kudos
2 Replies
RichardFairhurst
MVP Alum
I'm trying to apply a legend style from a .style file to an existing legend in my map document.
When calling the ListStyleItems function to select the .style file (as per: http://resources.arcgis.com/en/help/main/10.2/index.html#//00s300000074000000) however, an error is produced:

import arcpy arcpy.mapping.ListStyleItems("USER_STYLE", "Legend Items")


produces the error:

Runtime error <type 'exceptions.AttributeError'>: 'module' object has no attribute 'ListStyleItems'

also, when typing in the ArcMap python window, the ListStyleItems function does not show up in de function dropdown box:
[ATTACH=CONFIG]34404[/ATTACH]

So, where's the function gone? or is there a workaround to script legend styles? Specifically, I want to set the Show Layer name, Show Layer labels, etc. properties of the legend.

I'm using ArcMap 10.0 Desktop which runs on a server through a Citrix Client.


The help you referenced only applies to version 10.1 or higher per the what's new at 10.1 documentation.  As far as I know, there is no way to access it at 10.0 and upgrading is the only option.  You might be able to call it using an ArcObjects module somehow, but you would have to get someone else to help you with that.  Given that an upgrade will work much more robustly and you would be repeating the work the ESRI programmer's have done much better, I would push for the upgrade.
0 Kudos
WillemMaetens1
Deactivated User
Ah, should have noticed that. Thanks for the quick reply!
0 Kudos