Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have found some ArcObjects code to get unique values on one field for a IUniqueValueRenderer but I can't conceptually wrap my head around how to do that with 3 fields. Would this be .Net code or is there a property/method in the IUniqueValueRenderer?

My goal is to get a list of layer files with python (these layer files have symbology from a master symbology layer which generally has more unique value combinations than what the target layer file has..meaning that some of the values in the IUniqueValueRenderer needs to be removed with the RemoveValue) then call an this arcobjects exe that will, once passed the path to a layer, finds it's unique values (from 3 fields) then check the renderer and start to remove the ones that don't apply.

share|improve this question
up vote 1 down vote accepted

You are referring to ESRI.ArcGIS.Carto.IUniqueValueRenderer?

That interface includes a FieldCount property and Field that can be set with an index.

C# example...

pUniqueValueRenderer.FieldCount = 2;
pUniqueValueRenderer.set_Field(0, "Field 1");
pUniqueValueRenderer.set_Field(1, "Field 2");
pUniqueValueRenderer.FieldDelimiter = ",";

To loop each Field...

for (var i = 0; i < pUniqueValueRenderer.FieldCount; i++)
    string fieldName = pUniqueValueRenderer.get_Field(i);

ESRI Documentation

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.