In ArcMap how can I export a symbology style to table or text format such as .csv?
I found a kludge courtesy of Sephe Fox on GeoNet, extract the definition from a legend graphic:
add a legend to your map document containing only that layer. Then, right click on the legend and convert to graphics. You will have to ungroup the legend and also each of the symbology types, but then you can select the boxes with just the text, by dragging a rectangle around all of them, and copy. You can then paste them as text into Excel, and each will be on a new row.
After you have everything in rows use Excel's "Data >> Text to Columns >> Delimiter '
('" to split
Label (value) into separate fields and then Search & Replace
) with nothing.
It works but is cumbersome and not what I'd call a solution. Still if you're in bind this might let you keep going.
Another approach is mine the map's Service Definition Draft (File >> Share as service >> Save as service definition file >> Choose 'No connection') , unzip the archive, locate the
.msd file, unzip that, find
layer_name.xml, then in Excel Open as XML Table and scan for columns
FieldName, String, Label.
(Note the RGB columns which might be useful for the related Saving a ArcMap layers RGB values into the attribute table question.)
There is an arcpy snippet in Getting layers from .msd using ArcPy? for getting to the layer file, and a more fully developed script at Using ArcPy to get layer symbology?. I've lost track of the original Q/A that led me to the idea of using a service definition.