ArcGIS Desktop – Creating Summary Table of Symbology for Multiple MXDs

arcgis-desktoparcpycartography

This is related to the following Retain ESRI symbology in Mapinfo TAB . As an initial step (in arcpy) I want to access the symbology of all the datasets and create a document which has the details of the symbology as per the graphic below.
enter image description here

Is this possible (should I invest the time to work it out) or if it isn't possible I will just have to get cracking on doing it manually on hundreds of MXD's (:-

To break down the steps -hopefully I can automate at least part of the process.

  1. scrolling through mxd's and getting the datasets that are on is no problem

    lyrFile = arcpy.mapping.Layer
    if lyrFile.visible == True:

  2. as it finds a dataset it should create a .lyr file (as most are just shp/gdb files) and then AttribXXX=lyrFile.xxx

where XXX and xxx are

BRIGHTNESS = lyrFile.brightness

(above format to following)

CONTRAST —contrast
DATASETNAME —datasetName
DATASOURCE —dataSource
DESCRIPTION —description
LABELCLASSES —labelClasses
LONGNAME —longName
NAME —name
SHOWLABELS —showLabels
TRANSPARENCY —transparency
WORKSPACEPATH —A layer's workspace or connection file path

The issue is I can't find anything that gets the RGB, line/point/polygon type, line weights, font etc. If these can be found then the next step

  1. write each of the values above to a CSV (easy)…for example (this has to be expanded)

                    f = open(origPath+'\\LayerAtrributes_LOG.txt', 'a')
                    f.write(str(DATASETNAME)+","+str(DATASOURCE)+","+str(DESCRIPTION)+","+str(MXDName)+"\n")
                    f.close()
    
  2. If possible a jpg of the symbology should be produced as in the example and the link to it added to the csv.

Am is asking to much of arcpy?

Best Answer

I solved a similar problem by converting an MXD document to a MSD (which is just a zip file) so if you change the extension to ".zip" and open it you will find some .xml documents that contain alot of information about how each layer within the mxd is displayed. arcpy.ConvertToMSD There might be some work involed in getting the information you want but it should be in there somewhere. Hope that helps!