Read layer symbology class color with ArcPy

1862
5
09-13-2013 04:12 AM
JohnMorgan
New Contributor III
I am using ArcPy within ArcGIS 10.1 and attempting to read symbology from a *.lyr file created by a raster dataset within ArcMap. My goal is to be able read out the RGB (color) values assigned to the class breaks on the dataset. It???s seems easy enough to get the lyr file into an object with:

lyrFile = arcpy.mapping.Layer("C:/.../ReadLyrFileSymbology/conus_foresttype6.img.lyr")


However, after that I am unable to find the method or property to get symbology color (RGB) on a layer. Any pointers would be greatly appreciated.

Thanks,
Derek
Tags (2)
0 Kudos
5 Replies
MattSayler
Occasional Contributor II
I don't think it's currently possible using python, unless someone has sorted out a way to parse out the lyr file directly. Applying an existing lyr file to a layer in the ToC is about the extent of what can be done to manipulate symbology using python in 10.1.

I think it's probably on the Esri radar though, as a lot of people want to be able to do those sorts of things. They seem to be expanding arcpy every release, so it's probably only a matter of time. That doesn't really help you NOW though.
0 Kudos
ZdenkaHofman
New Contributor
I'm trying to do something similar as well.  I'd like to be able to use the RGB values and the associated to labels in a separate graphics software.  Even being able to print a list would be helpful.
0 Kudos
JasonScheirer
Regular Contributor II
Can't do it in arcpy.
0 Kudos
AgataZurek
New Contributor III

Any update on this?

Jason Scheirer, do you know if this will be made available?

Thanks!

0 Kudos
JasonScheirer
Regular Contributor II

This is beyond the scope of the initial arcpy.mapping design, so we don't intend on adding it

There will be a roundabout way of doing some color-level symbology manipulation in 10.3 via JSON layer definitions.

0 Kudos