Select to view content in your preferred language

How to delete the entire legend (not just the elements) using Arcpy

3430
3
Jump to solution
06-25-2013 12:38 PM
ChrisJudd1
Occasional Contributor
I have looked everywhere in the API to try to find a way to delete the entire legend from a dataframe using Arcpy, but I have not been able to find the correct method.  Could someone point me in the right direction?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
DavidAllen
Frequent Contributor
I have looked everywhere in the API to try to find a way to delete the entire legend from a dataframe using Arcpy, but I have not been able to find the correct method.  Could someone point me in the right direction?


arcpy.mapping doesn't let you add or subtract elements from your layout. The help files suggest that if you have an element that you don't wish to display on the output, change the location of the element to be off the page using the .elementPositionX property.

View solution in original post

0 Kudos
3 Replies
DavidAllen
Frequent Contributor
I have looked everywhere in the API to try to find a way to delete the entire legend from a dataframe using Arcpy, but I have not been able to find the correct method.  Could someone point me in the right direction?


arcpy.mapping doesn't let you add or subtract elements from your layout. The help files suggest that if you have an element that you don't wish to display on the output, change the location of the element to be off the page using the .elementPositionX property.
0 Kudos
ChrisJudd1
Occasional Contributor
Worked like a charm, thank you!  I set the set the legend's elementPositionX to -5000, like below and no more legend:

elementPositionX = -5000
0 Kudos
Yaron_YosefCohen
Frequent Contributor

Chris, can you please write the all script-this attached script don't work ?

0 Kudos