ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Core Namespace / VertexSymbolOptions Class
Members Example

In This Topic
    VertexSymbolOptions Class
    In This Topic
    Defines the options used for vertex symbols while sketching.
    Object Model
    VertexSymbolOptions ClassCIMColor ClassCIMPointSymbol ClassCIMColor Class
    Syntax
    Public Class VertexSymbolOptions 
    public class VertexSymbolOptions 
    Example
    Customizing the Sketch Symbol of a Custom Sketch Tool
    /// <summary>
    /// Within the specialization of a MapTool, this method handles activation and deactivation of the tool, allowing customization of sketch segment and vertex symbology when
    /// the tool becomes active.  When the tool is activated, this method customizes the appearance of sketch segments and vertices by updating their symbol options. This includes setting colors, widths, marker types, and other visual properties for both segments and regular unselected vertices.
    /// </summary>
    protected override Task OnToolActivateAsync(bool active)
    {
      QueuedTask.Run(() =>
      {
        //Getting the current symbology options of the segment
        var segmentOptions = GetSketchSegmentSymbolOptions();
        //Modifying the primary and secondary color and the width of the segment symbology options
        var deepPurple = new CIMRGBColor() { R = 75, G = 0, B = 110 };
        segmentOptions.PrimaryColor = deepPurple;
        segmentOptions.Width = 4;
        segmentOptions.HasSecondaryColor = true;
        var pink = new CIMRGBColor() { R = 219, G = 48, B = 130 };
        segmentOptions.SecondaryColor = pink;
        //Creating a new vertex symbol options instance with the values you want
        var vertexOptions = new VertexSymbolOptions(VertexSymbolType.RegularUnselected);
        var yellow = new CIMRGBColor() { R = 255, G = 215, B = 0 };
        var purple = new CIMRGBColor() { R = 148, G = 0, B = 211 };
        vertexOptions.AngleRotation = 45;
        vertexOptions.Color = yellow;
        vertexOptions.MarkerType = VertexMarkerType.Star;
        vertexOptions.OutlineColor = purple;
        vertexOptions.OutlineWidth = 3;
        vertexOptions.Size = 5;
    
        //Setting the value of the segment symbol options
        SetSketchSegmentSymbolOptions(segmentOptions);
        //Setting the value of the vertex symbol options of the regular unselected vertices using the vertexOptions instance created above.
        SetSketchVertexSymbolOptions(VertexSymbolType.RegularUnselected, vertexOptions);
      });
    
      return base.OnToolActivateAsync(active);
    }
    Get Sketch Vertex Symbology Options
    {
      var options = ApplicationOptions.EditingOptions;
      await QueuedTask.Run(() =>
      {
        //There are 4 vertex symbol settings - selected, unselected and the
        //current vertex selected and unselected.
        var reg_select = options.GetVertexSymbolOptions(VertexSymbolType.RegularSelected);
        var reg_unsel = options.GetVertexSymbolOptions(VertexSymbolType.RegularUnselected);
        var curr_sel = options.GetVertexSymbolOptions(VertexSymbolType.CurrentSelected);
        var curr_unsel = options.GetVertexSymbolOptions(VertexSymbolType.CurrentUnselected);
    
        //to convert the options to a symbol use
        //GetPointSymbol
        var reg_sel_pt_symbol = reg_select.GetPointSymbol();
        //ditto for reg_unsel, curr_sel, curr_unsel
      });
    }
    Set Sketch Vertex Symbol Options
    {
      var options = ApplicationOptions.EditingOptions;
      //var options = ApplicationOptions.EditingOptions;
      await QueuedTask.Run(() =>
      {
        //change the regular unselected vertex symbol
        //default is a green, hollow, square, 5pts. Change to
        //Blue outline diamond, 10 pts
        var vertexSymbol = new VertexSymbolOptions(VertexSymbolType.RegularUnselected);
        vertexSymbol.OutlineColor = ColorFactory.Instance.BlueRGB;
        vertexSymbol.MarkerType = VertexMarkerType.Diamond;
        vertexSymbol.Size = 10;
    
        //Are these valid?
        if (options.CanSetVertexSymbolOptions(
             VertexSymbolType.RegularUnselected, vertexSymbol))
        {
          //apply them
          options.SetVertexSymbolOptions(VertexSymbolType.RegularUnselected, vertexSymbol);
        }
      });
    }
    Set Sketch Vertex Symbol Back to Default
    {
      var options = ApplicationOptions.EditingOptions;
      //var options = ApplicationOptions.EditingOptions;
      await QueuedTask.Run(() =>
      {
        //ditto for reg selected and current selected, unselected
        var def_reg_unsel =
          options.GetDefaultVertexSymbolOptions(VertexSymbolType.RegularUnselected);
        //apply default
        options.SetVertexSymbolOptions(
          VertexSymbolType.RegularUnselected, def_reg_unsel);
      });
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Core.VertexSymbolOptions

    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also