Thursday, 23 March 2017

arcgis desktop - Creating summary table of symbology of all datasets in multiple MXDs?


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?



Answer



Basically this was not possible but figured out a roundabout way to get the result. See arcgis python script to tool issue for final result.


Other questions to get to this stage are



Converting ArcGIS style (symbology) to font for MapInfo/OpenGeo?


Retain ESRI symbology in Mapinfo TAB


and


Creating summary table of symbology of all datasets in multiple MXDs?


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...