ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMSimpleRenderer Class / Symbol Property
Example

In This Topic
    Symbol Property (CIMSimpleRenderer)
    In This Topic
    Gets or sets the symbol.
    Syntax
    public CIMSymbolReference Symbol {get; set;}
    Public Property Symbol As CIMSymbolReference
    Example
    How to apply a symbol from style to a feature layer
    {
      await QueuedTask.Run(() =>
      {
      //Get simple renderer from the feature layer
      CIMSimpleRenderer currentRenderer = featureLayer.GetRenderer() as CIMSimpleRenderer;
      if (currentRenderer == null)
      {
        return;
      }
      //Get symbol from the SymbolStyleItem
      CIMSymbol symbolToApply = symbolStyleItem.Symbol;
    
      //Set symbol's real world setting to be the same as that of the feature layer
      symbolToApply.SetRealWorldUnits(featureLayer.UsesRealWorldSymbolSizes);
    
      //Update the symbol of the current simple renderer
      currentRenderer.Symbol = symbolToApply.MakeSymbolReference();
      //Update the feature layer renderer
        featureLayer.SetRenderer(currentRenderer);
      });
    }
    How to apply a point symbol from a style to a feature layer
    {
          //Get the ArcGIS 2D System style from the Project
          var arcGIS2DStyle =
    Project.Current.GetItems<StyleProjectItem>().FirstOrDefault(s => s.Name == "ArcGIS 2D");
    
          await QueuedTask.Run(() =>
          {
          //Search for the symbolName style items within the ArcGIS 2D style project item.
          var items = arcGIS2DStyle.SearchSymbols(StyleItemType.PointSymbol, "Circle 1");
    
          //Gets the CIMSymbol
          CIMSymbol symbolToUse = items.FirstOrDefault().Symbol;
    
          //Get the renderer of the point feature layer
          CIMSimpleRenderer renderer = featureLayer.GetRenderer() as CIMSimpleRenderer;
    
          //Set symbol's real world setting to be the same as that of the feature layer
          symbolToUse.SetRealWorldUnits(featureLayer.UsesRealWorldSymbolSizes);
    
          //Apply the symbol to the feature layer's current renderer
          renderer.Symbol = symbolToUse.MakeSymbolReference();
    
          //Apply the renderer to the feature layer
            featureLayer.SetRenderer(renderer);
          });
        }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also