I tried to use the inspector and edit operation to clip selected feature from a feature class, but I am getting an error at SelectedLayer. I am also not sure how I should address oid. Is this the oid of the new clipped feature class? Please see my code below. Thanks for your help!
public async Task SelectionLayer_Inspector()
await QueuedTask.Run(() =>
var MV = MapView.Active;
var MU_Layer = MV.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().Where(fl => fl.Name.Contains("MUPOLYGON")).FirstOrDefault();
var SelectedLayer = MV.Map.GetSelection();
var oid = new List<long>();
var inspector = new Inspector();
var Mukeys = inspector["mukey"];
var clipOp = new EditOperation();
clipOp.Name = "clip the selected layer";
clipOp.Clip(MU_Layer, oid, SelectedLayer, ClipMode.PreserveArea);
At first "return Mukeys;" breaks code execution at this point and your clip operation will not be executed.
More information about EditOperation Clip method here:
From your question difficult to understand that task do you want to realize. Do you want to clip single feature or selected features? What is your clipping geometry and etc.
I want to clip the selected feature from MUPOLYGON. I basically want to extract the selected input feature, SelectionLayer that overlay the clip feature, MUPOLYGON. Thanks for your help!