ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / UniqueValueRendererDefinition Class / UseDefaultSymbol Property
Example

In This Topic
    UseDefaultSymbol Property (UniqueValueRendererDefinition)
    In This Topic
    Gets or sets a boolean to indicate that DefaultSymbol will be used to draw features whose values are not found in the values list.
    Syntax
    public bool UseDefaultSymbol {get; set;}
    Public Property UseDefaultSymbol As Boolean
    Remarks
    You should use this when there are more unique values that what you set as ValuesLimit.
    Example
    Use Arcade expression to create Class Breaks
    {
      var usaStatesLayer = map.GetLayersAsFlattenedList().OfType<FeatureLayer>()
                     .FirstOrDefault(fl => fl.Name == "USA States");
      if (usaStatesLayer == null)
      {
        return;
      }
    
      await QueuedTask.Run(() =>
      {
      //Create a color ramp from red to blue
      var colorRampForPopulation = ColorFactory.Instance.ConstructColorRamp(
            ColorRampAlgorithm.LinearContinuous,
            ColorFactory.Instance.RedRGB, ColorFactory.Instance.BlueRGB);
    
      //This Arcade expression categorizes the POP2000 field in the usaStates layer
      //into Low, Medium, and High values
      var arcade = @"if ($feature.POP2000 < 1000000)
                       {return ""Low"";}" +
                   @"else if ($feature.POP2000 >= 100000 && $feature.POP2000 < 5000000)
                      {return ""Medium""; }" +
                    @"else if ($feature.POP2000 >= 5000000)
                      {return ""High"";}" +
                    @"else{return ""NA"";}";
      //Create the Arcade expression info
      CIMExpressionInfo arcadeExp = new CIMExpressionInfo();
      arcadeExp.Expression = arcade;
      arcadeExp.ReturnType = ExpressionReturnType.Default;
      arcadeExp.Title = "State Population Categorized";
      arcadeExp.Name = "USA States Population 2000";
    
      //Each population category is assigned a color from the color ramp and symbolized on the map
      // using a unique value renderer
      var uvr_desc = new UniqueValueRendererDefinition()
      {
        //ValueFields = new List<string> { "STATION" },
        ColorRamp = colorRampForPopulation,
        UseDefaultSymbol = true,
        ValuesLimit = 100,
        ArcadeExpression = arcadeExp.Expression
      };
      //Create the renderer and assign it to the layer
      var renderer = usaStatesLayer.CreateRenderer(uvr_desc);
      usaStatesLayer.SetRenderer(renderer);
      });
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also