ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Editing Namespace / EditOperation Class / EditOperation Constructor
Example

In This Topic
    EditOperation Constructor
    In This Topic
    Constructs a new EditOperation representing an edit to be performed against the Geodatabase.
    Syntax
    Public Function New()
    public EditOperation()
    Example
    Edit Operation Create Features
    // Creates new features in a feature layer using the specified geometry, attributes, or editing template.
    await QueuedTask.Run(() =>
    {
      var createFeatures = new EditOperation() { Name = "Create Features" };
      //Create a feature with a polygon
      var token = createFeatures.Create(featureLayer, polygon);
      if (createFeatures.IsSucceeded)
      {
        // token.ObjectID will be populated with the objectID of the created feature after Execute has been successful
      }
      //Do a create features and set attributes
      var attributes = new Dictionary<string, object>
    {
      { "SHAPE", polygon },
      { "NAME", "Corner Market" },
      { "SIZE", 1200.5 },
      { "DESCRIPTION", "Corner Market" }
    };
      createFeatures.Create(featureLayer, attributes);
    
      //Create features using the current template
      //Must be within a MapTool
      createFeatures.Create(currentTemplate, polygon);
    
      //Execute to execute the operation
      //Must be called within QueuedTask.Run
    
      if (!createFeatures.IsEmpty)
      {
        //Execute will return true if the operation was successful and false if not.
        createFeatures.Execute();
        //or use async flavor
        //await createFeatures.ExecuteAsync();
      }
    });
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also