Here is my code
@sonj wrote:
We are upgrading the VBA tool to 10.6 version. The objective is to cut the polygon using IFeatureEdit2.SplitWithUpdate. After running the tool the split polygon disappears.
IEditor m_editor;
ESRI.ArcGIS.esriSystem.UID editorUid = new ESRI.ArcGIS.esriSystem.UID();
editorUid.Value = "esriEditor.Editor";
m_editor = ArcMap.Application.FindExtensionByCLSID(editorUid) as ESRI.ArcGIS.Editor.IEditor;
Application.DoEvents();
IFeatureEdit2 featureEdit = PolygonFeature as IFeatureEdit2;
ISet newFeaturesSet = featureEdit.SplitWithUpdate(NewPolyline);
newFeaturesSet.Reset();
IFeature newFeature = null;
while ((newFeature = newFeaturesSet.Next() as IFeature) != null)
{
IInvalidArea invalidArea;
invalidArea = new InvalidArea();
invalidArea.Display = m_editor.Display;
invalidArea.Add(newFeature);
invalidArea.Invalidate(-2);
newFeature.Store();
WriteReport(string.Format("Line ID {0}, Original Polygon ID {1}, New Polygon ID {2}", LineFeature.OID, PolygonFeature.OID, newFeature.OID));
ArcMap.Document.ActiveView.ScreenDisplay.Invalidate(null, false, (short)esriScreenCache.esriAllScreenCaches);
ArcMap.Document.ActiveView.ScreenDisplay.UpdateWindow();
}