ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Core Namespace / ApplicationOptions Class / EditingOptions Property
Example

In This Topic
    EditingOptions Property
    In This Topic
    Gets the application editing options.
    Syntax
    public static EditingOptions EditingOptions {get;}
    Public Shared ReadOnly Property EditingOptions As EditingOptions
    Example
    Get/Set Editing Options
    //toggle, switch option values
    var options = ApplicationOptions.EditingOptions;
    
    options.EnforceAttributeValidation = !options.EnforceAttributeValidation;
    options.WarnOnSubtypeChange = !options.WarnOnSubtypeChange;
    options.InitializeDefaultValuesOnSubtypeChange = !options.InitializeDefaultValuesOnSubtypeChange;
    options.UncommitedAttributeEdits = (options.UncommitedAttributeEdits == 
      UncommitedEditMode.AlwaysPrompt) ? UncommitedEditMode.Apply : UncommitedEditMode.AlwaysPrompt;
    
    options.StretchGeometry = !options.StretchGeometry;
    options.StretchTopology = !options.StretchTopology;
    options.UncommitedGeometryEdits = (options.UncommitedGeometryEdits == 
      UncommitedEditMode.AlwaysPrompt) ? UncommitedEditMode.Apply : UncommitedEditMode.AlwaysPrompt;
    
    options.ActivateMoveAfterPaste = !options.ActivateMoveAfterPaste;
    options.ShowFeatureSketchSymbology = !options.ShowFeatureSketchSymbology;
    options.FinishSketchOnDoubleClick = !options.FinishSketchOnDoubleClick;
    options.AllowVertexEditingWhileSketching = !options.AllowVertexEditingWhileSketching;
    options.ShowDeleteDialog = !options.ShowDeleteDialog;
    options.EnableStereoEscape = !options.EnableStereoEscape;
    options.DragSketch = !options.DragSketch;
    options.ShowDynamicConstraints = !options.ShowDynamicConstraints;
    options.IsDeflectionDefaultDirectionConstraint = 
      !options.IsDeflectionDefaultDirectionConstraint;
    options.IsDirectionDefaultInputConstraint = !options.IsDirectionDefaultInputConstraint;
    options.ShowEditingToolbar = !options.ShowEditingToolbar;
    options.ToolbarPosition = (options.ToolbarPosition == ToolbarPosition.Bottom) ? 
              ToolbarPosition.Right : ToolbarPosition.Bottom;
    options.ToolbarSize = (options.ToolbarSize == ToolbarSize.Medium) ? 
              ToolbarSize.Small : ToolbarSize.Medium;
    options.MagnifyToolbar = !options.MagnifyToolbar;
    
    options.EnableEditingFromEditTab = !options.EnableEditingFromEditTab;
    options.AutomaticallySaveEdits = !options.AutomaticallySaveEdits;
    options.AutoSaveByTime = !options.AutoSaveByTime;
    options.SaveEditsInterval = (options.AutomaticallySaveEdits) ? 20 : 10;
    options.SaveEditsOperations = (options.AutomaticallySaveEdits) ? 60 : 30;
    options.SaveEditsOnProjectSave = !options.SaveEditsOnProjectSave;
    options.ShowSaveEditsDialog = !options.ShowSaveEditsDialog;
    options.ShowDiscardEditsDialog = !options.ShowDiscardEditsDialog;
    options.DeactivateToolOnSaveOrDiscard = !options.DeactivateToolOnSaveOrDiscard;
    options.NewLayersEditable = !options.NewLayersEditable;
    
    Get/Set Editing Annotation Options
    var eOptions = ApplicationOptions.EditingOptions;
    
    var followLinkedLines = eOptions.AutomaticallyFollowLinkedLineFeatures;
    var followLinedPolygons = eOptions.AutomaticallyFollowLinkedPolygonFeatures;
    var usePlacementProps = eOptions.UseAnnotationPlacementProperties;
    var followMode = eOptions.AnnotationFollowMode;
    var placementMode = eOptions.AnnotationPlacementMode;
    
         
    eOptions.AnnotationFollowMode = AnnotationFollowMode.Parallel;
    eOptions.AnnotationPlacementMode = AnnotationPlacementMode.Left;
    Get Sketch Vertex Symbology Options
    var options = ApplicationOptions.EditingOptions;
    
    //Must use QueuedTask
    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
    });
    
    Get Sketch Segment Symbology Options
    //var options = ApplicationOptions.EditingOptions;
    QueuedTask.Run(() =>
    {
      var seg_options = options.GetSegmentSymbolOptions();
      //to convert the options to a symbol use
      //SymbolFactory. Note: this is approximate....sketch isn't using the
      //CIM directly for segments
      var layers = new List<CIMSymbolLayer>();
      var stroke0 = SymbolFactory.Instance.ConstructStroke(seg_options.PrimaryColor, 
        seg_options.Width, SimpleLineStyle.Dash);
      layers.Add(stroke0);
      if (seg_options.HasSecondaryColor) {
        var stroke1 = SymbolFactory.Instance.ConstructStroke(
          seg_options.SecondaryColor, seg_options.Width, SimpleLineStyle.Solid);
        layers.Add(stroke1);
      }
      //segment symbology only
      var sketch_line = new CIMLineSymbol() {
        SymbolLayers = layers.ToArray()
      };
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also