AnsweredAssumed Answered

arcpy unique values many fields symbology

Question asked by PSoares on Feb 19, 2020
Latest reply on Feb 19, 2020 by bixb0012

Hi there,

 

I am doing a very simple python script. That should run for ARCGIS 10.5.1.

The goal is to switch the symbols categories of several FCs (layers in TOC) from "Unique values" to "Unique values, many fields". where the first value is the existing "value field" and the second would be "NGI". I cannot find a way of having the second value for symbolizing my layers...

I just put the code part where i have the doubt, before bellow there is a connection to the mxd and then to the layers:

(...)

if lyr.isFeatureLayer==True:

   lSymbol=lyr.symbology

   lExisting = lSymbol.valueField

   lExisting = str(lExisting)   

   lSymbol.valueField=lExisting

   lSymbol.addAllValues() ## until this point it does only for one value field

   ## the problem is if i do the next part it overwrites the above...

   lSymbol.valueField="NGI"

   lSymbol.addAllValues()

(...)

mxd=Save()

 

 

I have 27 mxds pointing to the same GDB ... in each there are more than 100 Layers. Each layer has a definition query that defines the location (states in US and Europe) that is stored in "NGI"... but if i want to edit anything the templates are not showing nothing, because the templates do not work with definition queries unless manually we had the "NGI" of the location of the mxd. The work around i though of is to the above... still not working.

 

 

Cheers and thanks for the help

PS

Outcomes