ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Core Namespace / EditingOptions Class / SetSegmentSymbolOptions Method
The new segment symbol
Example

In This Topic
    SetSegmentSymbolOptions Method
    In This Topic
    Sets the segment sketch symbol. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public void SetSegmentSymbolOptions( 
       SegmentSymbolOptions segmentSymbol
    )
    Public Sub SetSegmentSymbolOptions( _
       ByVal segmentSymbol As SegmentSymbolOptions _
    ) 

    Parameters

    segmentSymbol
    The new segment symbol
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Symbol options are not valid. See CanSetSegmentSymbolOptions for details on option settings.
    Remarks
    This method calls the CanSetSegmentSymbolOptions function prior to setting the symbol values. If the options are invalid, no updates are made to the symbol.
    Example
    Set Sketch Segment Symbol Options
    //var options = ApplicationOptions.EditingOptions;
    QueuedTask.Run(() =>
    {
      //change the segment symbol primary color to green and
      //width to 1 pt
      var segSymbol = options.GetSegmentSymbolOptions();
      segSymbol.PrimaryColor = ColorFactory.Instance.GreenRGB;
      segSymbol.Width = 1;
    
      //Are these valid?
      if (options.CanSetSegmentSymbolOptions(segSymbol)) {
        //apply them
        options.SetSegmentSymbolOptions(segSymbol);
              }
    });
    
    Set Sketch Segment Symbol Back to Default
    //var options = ApplicationOptions.EditingOptions;
    QueuedTask.Run(() =>
    {
      var def_seg = options.GetDefaultSegmentSymbolOptions();
      options.SetSegmentSymbolOptions(def_seg);
    });
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also