Hello,I have a VB.NET addin button that activates the ArcMap "split command" for the user and then updates the attributes of the resulting arcs. I would like to make another button that is almost identical, but using the "split tool" instead of the "split command". However, the new arc is not selected after the split tool executes, so I am unable to update its attributes. I would like to add the new arc to the selection set, possibly by referring to its OBJECTID. I know that the OBJECTID of the new arc is the largest one in the edited (unsaved) version of the feature class, but if I reference the feature class via its layer in ArcMap, I will only see the pre-edited version (without the new feature). Any suggestions how I can get around this issue?Thanks!Kerry
UID editorUid = new UID(); editorUid.Value = "esriEditor.Editor"; IEditor3 m_editor = ArcMap.Application.FindExtensionByCLSID(editorUid) as IEditor3; m_editEvents = m_editor as IEditEvents_Event; //To get the original feature // m_editEvents.OnChangeFeature += new IEditEvents_OnChangeFeatureEventHandler(m_editEvents_OnChangeFeature); //Get the new feature m_editEvents.OnCreateFeature += new IEditEvents_OnCreateFeatureEventHandler(m_editEvents_OnCreateFeature);
void m_editEvents_OnCreateFeature(IObject obj) { IFeatureSelection pFeatSel = arcFeatureLayer as IFeatureSelection; pFeatSel.Add(obj as IFeature); ArcMap.Document.ActivatedView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, null); }
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.