Split with Update

775
2
03-01-2024 01:58 AM
sonj
by
Occasional Contributor

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. 

Tags (1)
0 Kudos
2 Replies
BrentHoskisson
Frequent Contributor

For the best reponses you should post your code and explain what debugging you have tried so far.  If this is an ESRI tool that is not working, you have posted in the wrong community.

Brent Hoskisson

0 Kudos
sonj
by
Occasional Contributor

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();
}
0 Kudos