// Modifies the "NAME" attribute of a specified feature and then splits the feature using the provided polyline, all within a single sequential edit operation.
// perform an edit and then a split as one operation.
await QueuedTask.Run(() =>
{
var newName = "Modified then Split";
var queryFilter = new QueryFilter() { WhereClause = "OBJECTID = " + objectId.ToString() };
// create an edit operation and name.
var op = new EditOperation
{
Name = "modify followed by split", // set the ExecuteMode
ExecuteMode = ExecuteModeType.Sequential
};
using (var rowCursor = layer.Search(queryFilter))
{
while (rowCursor.MoveNext())
{
using var feature = rowCursor.Current as ArcGIS.Core.Data.Feature;
op.Modify(feature, "NAME", newName);
}
}
op.Split(layer, objectId, splitLine);
if (!op.IsEmpty)
{
bool result = op.Execute();
}
// else
// The operation doesn't make any changes to the database so if executed it will fail
});