Select to view content in your preferred language

Deleting symbology within a layer.

864
3
08-29-2012 07:58 AM
HarrietFoster
Deactivated User
I am currently having an issue. I am trying to remove symbology from a shapefile layer. I have a folder of multiple layers, of which each layer has 30 symbols associated to it, but a number of layers only represent 3 or so symbols. However all 30 symbols are displayed in the table of content.
I have been googling like mad today but my search has not produced any results, only finding scripts to change symbology.
I was wondering if it was even possible to do this. My understanding of python would be to find out the attribute value which relates to the symbol and if it equals 0 then it should be removed.

Kind regards
Tags (2)
0 Kudos
3 Replies
ChristopherThompson
Frequent Contributor
I think at 10.1 there is finally the capability to create dynamic legends where only the items that appear in a view will display in the legend.  Which means potentially that you could do what you want without programming.  Is that what you are getting at? See http://resources.arcgis.com/en/help/main/10.1/index.html#//0103000000n1000000

Since the help for this suggests that dynamic legends are a type of dynamic table I think you may be able to control those with arcpy.mapping (http://resources.arcgis.com/en/help/main/10.1/index.html#//00s300000040000000) but I don't have 10.1 as of yet so can't say for sure if that is the case.

Probably even more important to what you want to do is found here:
http://resources.arcgis.com/en/help/main/10.1/index.html#/LegendElement/00s300000041000000/
read especially about the properties:

  • use_visible_extent: A Boolean that controls if only the features in the data frame's visible extent will be displayed in the legend.

  • use_ddp_extent A Boolean that controls if only the features within the Data Driven Pages index layer feature will be displayed in the legend. Data Driven Pages must be enabled.

Of course, this is all about legends in a map, and not about layers stored as .lyr files on disk somewhere.  I think other discussions i've seen and participated in, that ESRI folks will tell you that you really need to be developing with arcObjects to have that sort of control over your layer symbols.  Ultimately it depends on your goals.
0 Kudos
HarrietFoster
Deactivated User
Thank you ! I shall definitely crack on with this. Thanks again.
0 Kudos
ChristopherThompson
Frequent Contributor
Let me know if you have any success with this, without 10.1 at my fingertips I'm very curious to see how this might be approached.
0 Kudos