ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Core Namespace / TextAndGraphicsElementsOptions Class / GetDefaultPolygonSymbol Method
Example

In This Topic
    GetDefaultPolygonSymbol Method
    In This Topic
    Gets the application default polygon symbol. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function GetDefaultPolygonSymbol() As CIMPolygonSymbol
    public CIMPolygonSymbol GetDefaultPolygonSymbol()

    Return Value

    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Get TextAndGraphicsElementsOptions
    {
      //Note: Must be on QueuedTask.Run
      //Get the default font (see also 'SymbolFactory.Instance.DefaultFont')
      var def_font = ApplicationOptions.TextAndGraphicsElementsOptions.GetDefaultFont();
      System.Diagnostics.Debug.WriteLine(
        $"\r\ndefault font: {def_font.fontName}, {def_font.styleName}");
    
      //Get the default graphics element symbols - point, line, poly, text
      var ptSymbol = ApplicationOptions.TextAndGraphicsElementsOptions.GetDefaultPointSymbol();
      var lineSymbol = ApplicationOptions.TextAndGraphicsElementsOptions.GetDefaultLineSymbol();
      var polySymbol = ApplicationOptions.TextAndGraphicsElementsOptions.GetDefaultPolygonSymbol();
      var textSymbol = ApplicationOptions.TextAndGraphicsElementsOptions.GetDefaultTextSymbol();
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also