try
{
var myParcelFabricLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<ParcelLayer>().FirstOrDefault();
if (myParcelFabricLayer == null)
return "Parcel layer not found in map.";
var theActiveRecord = myParcelFabricLayer.GetActiveRecord();
var guid = theActiveRecord.Guid;
var editOper = new EditOperation()
{
Name = "Build Parcels",
ProgressMessage = "Build Parcels...",
ShowModalMessageAfterFailure = true,
SelectNewFeatures = true,
SelectModifiedFeatures = true
};
editOper.BuildParcelsByRecord(myParcelFabricLayer, guid);
if (!editOper.Execute())
return editOper.ErrorMessage;
}
catch (Exception ex)
{
return ex.Message;
}
return "";