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:
lExisting = lSymbol.valueField
lExisting = str(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...
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
If you are using ArcMap/ArcCatalog, and don't mind using undocumented ArcPy methods, you can use to dump a JSON definition of the symbology and then use Apply Symbology From Layer—Help | Documentation to apply changes.