ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Core Namespace / TextAndGraphicsElementsOptions Class / SetDefaultPolygonSymbol Method
The default polygon symbol to set
Example

In This Topic
    SetDefaultPolygonSymbol Method
    In This Topic
    Sets the application default polygon symbol. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public void SetDefaultPolygonSymbol( 
       CIMPolygonSymbol polygonSymbol
    )
    Public Sub SetDefaultPolygonSymbol( _
       ByVal polygonSymbol As CIMPolygonSymbol _
    ) 

    Parameters

    polygonSymbol
    The default polygon symbol to set
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Set TextAndGraphicsElementsOptions
    QueuedTask.Run(() =>
    {
      //Set a default font. Use its default style
      ApplicationOptions.TextAndGraphicsElementsOptions.SetDefaultFont("tahoma");
      //or specify an explicit style
      ApplicationOptions.TextAndGraphicsElementsOptions.SetDefaultFont("tahoma", "bold");
    
      //Create symbols
      var ptSymbol2 = SymbolFactory.Instance.ConstructPointSymbol(
        ColorFactory.Instance.RedRGB, 14, SimpleMarkerStyle.Diamond);
      var lineSymbol2 = SymbolFactory.Instance.ConstructLineSymbol(
        ColorFactory.Instance.RedRGB, 2, SimpleLineStyle.Dash);
      var polySymbol2 = SymbolFactory.Instance.ConstructPolygonSymbol(
        ColorFactory.Instance.RedRGB, SimpleFillStyle.DiagonalCross);
      var textSymbol2 = SymbolFactory.Instance.ConstructTextSymbol(
        ColorFactory.Instance.RedRGB, 12);
    
      //Set default point, line, poly, text graphics element symbols
      ApplicationOptions.TextAndGraphicsElementsOptions.SetDefaultPointSymbol(ptSymbol2);
      ApplicationOptions.TextAndGraphicsElementsOptions.SetDefaultLineSymbol(lineSymbol2);
      ApplicationOptions.TextAndGraphicsElementsOptions.SetDefaultPolygonSymbol(polySymbol2);
      ApplicationOptions.TextAndGraphicsElementsOptions.SetDefaultTextSymbol(textSymbol2);
    });
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also