I am using ArcMap 10.0 Service pack 5. (government computer, no choice here). I am trying to automate a common mapping task...
I have a clipped layer (SoilsClipped - which has maybe 4 or 5 categories), and a layer with the symbology I want to use (SoilsSymbology - approximately 100 categories).
My goal is to get the clipped layer (SoilsClipped) to display in 50% transparent, Unique Values/many fields Color ramp, and a certain style of label. So I use:
With "False" for the symbology only parameter. (this seems to be the only way to get the 50% transparent and labels that I want)
This then resets the data source... so I reset it. But now I have ALL the symbols from the SoilsSymbology layer in the TOC, most of which aren't used in my SoilsClipped layer.
Is there a workaround for this? It looks like I would have access to other properties in 10.1 and upward that would make this method obsolete, but I can't figure out how to do this in 10.0.
Here is the code I am using right now...
cLeft,cRight = lyrSoils.dataSource.rsplit("\\",1) cRight = str(lyrSoils.datasetName) # set display properties arcpy.mapping.UpdateLayer(dfPlanView,lyrSoils,lyrSoilAttributeSource,False) #arcpy.ApplySymbologyFromLayer_management(lyrSoils.name, lyrSoilAttributeSource) # re-get layer pointer, it gets messed up with updatelayer lyrSoils = arcpy.mapping.ListLayers(mxdCurrent,"Soils Map") # fix data source lyrSoils.replaceDataSource(cLeft,"SHAPEFILE_WORKSPACE", cRight)