Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

FYI, 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.

Thanks.

share|improve this question

1 Answer 1

up vote 0 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

 
discard

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.