Select to view content in your preferred language

Automatically save edits does not recognize creating a feature programmatically

669
3
Jump to solution
11-11-2022 07:09 AM
BarbaraSchneider2
Frequent Contributor

In the Editing Options of a project, I choose to automatically save edits after 1 minute.

If I create a new feature manually, it is automatically saved after 1 minute. However, if I create the feature programmatically, it is not automatically saved after 1 minute.

To create the feature programmatically, I use a Construction Tool and the following code inside the method OnSketchCompleteAsync():

var createOperation = new EditOperation();
createOperation.Create(featLayer, attributes);

bool succeeded = await QueuedTask.Run(() =>
{
    return createOperation.Execute();                  
});

 Is there a way that the creation of my new feature is recognized by automatically save edits?

1 Solution

Accepted Solutions
Wolf
by Esri Regular Contributor
Esri Regular Contributor

What version of Pro are you using?  I was not able to duplicate this issue using ArcGIS Pro version 3.0.
I used createOperation.ExecuteAsync(); instead of the synchronous Execute method. 

View solution in original post

0 Kudos
3 Replies
BarbaraSchneider2
Frequent Contributor

This is a bug, I guess. I implemented a workaround to automatically save my edits after 1 minute using System.Windows.Threading.DispatcherTimer

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

What version of Pro are you using?  I was not able to duplicate this issue using ArcGIS Pro version 3.0.
I used createOperation.ExecuteAsync(); instead of the synchronous Execute method. 

0 Kudos
BarbaraSchneider2
Frequent Contributor

We are using ArcGIS Pro 2.9.5. I tried it with createOperation.ExecuteAsync() and it worked! Thank you.

0 Kudos