Hi there
I've spent quite a while searching online and ArcGIS/ArcPy Help for a solution with no success, so I wonder if someone could think of a way around this issue:
I would like to change the symbology Value Field of a Feature Class within an MXD. I need first to set the symbology of the FC to "Match to symbols in a style" using a Value Field and then use Python to change the Value Field keeping the same symbology style. I know that ArcGIS does not support "Match to symbols in a style" symbology Type but I wonder if there is away around this.
It would be something like the script below but replacing the symbology Type with "something else". Hope I explained the issue clearly. Many thanks.
<SPAN class="keyword token">import</SPAN> arcpy
mxd <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mapping<SPAN class="punctuation token">.</SPAN>MapDocument<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"CURRENT"</SPAN><SPAN class="punctuation token">)</SPAN>
lyrlist <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mapping<SPAN class="punctuation token">.</SPAN>ListLayers<SPAN class="punctuation token">(</SPAN>mxd<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">for</SPAN> lyr <SPAN class="keyword token">in</SPAN> lyrlist<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">if</SPAN> lyr<SPAN class="punctuation token">.</SPAN>symbologyType <SPAN class="operator token">==</SPAN> <SPAN class="string token">"UNIQUE_VALUES"</SPAN><SPAN class="punctuation token">:</SPAN>
lyr<SPAN class="punctuation token">.</SPAN>symbology<SPAN class="punctuation token">.</SPAN>valueField <SPAN class="operator token">=</SPAN> <SPAN class="string token">"DESCRIPTION"</SPAN>
lyr<SPAN class="punctuation token">.</SPAN>symbology<SPAN class="punctuation token">.</SPAN>addAllValues<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>RefreshActiveView<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>RefreshTOC<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">del</SPAN> mxd
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>