2

I've got various polyline shapefiles loaded in ArcGIS, each using the default line style with different colors. For a python addin I'm working on I would like to use arcpy to read the RGB value of these colors. Would that be possible?

I noticed this question: Read layer symbology class color with ArcPy But it deals with raster layers and therefore I assume my question is not a duplicate (please let me know if this is still the case)

3

This answer is as of ArcGIS Desktop 10.3.1. It could change in the future since arcpy.mapping is constantly evolving.

If you are using default line styles, then your layer.symbologyType should be equal to u'OTHER'.

There is no way through arcpy or arcpy.mapping to access the symbology properties for a layer with u'OTHER' symbology. You should get a result of "NameError: The attribute 'symbology' is not supported on this instance of Layer" when trying to access the symbology attribute for that layer.

Even if the symbology was one of the types supported by arcpy.mapping, none of the supported types currently supports reading the color values of individual symbols.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.