Behaviour of EngineEditor - OnVertexAdded creates Feature

Discussion created by GD_Lionel on Feb 11, 2011

I try to create my own Feature, wenn the event OnVertexAdded from the EngineEditor is fired.
That works fine - The event is thrown, I get the point of type IPoint and create my Feature.  Unfortunately this Creates two features because I am creating a feature and the EingineEditor also does.

How can I prevent the EingineEditor of creating a feature after I created mine? With the "classic" Editor of arcObject that doesn't happen.


for now, I solved it like that... but I'm not convinced

    Dim _featureToCreate As Boolean = False

    Private Sub _engineEditor_OnCreateFeature(ByVal obj As ESRI.ArcGIS.Geodatabase.IObject) Handles _engineEditor.OnCreateFeature
        If Not _featureToCreate Then
            DirectCast(obj, IFeature).Delete()
        End If
    End Sub

    Private Sub _engineEditor_OnVertexAdded(ByVal point As ESRI.ArcGIS.Geometry.IPoint) Handles _engineEditor.OnVertexAdded
        _featureToCreate = true
  'Throws my own event to create my feature
        EventOnVertexAdded(pPoint, GetCurrentNetDesignLayer)
        _featureToCreate = False
    End Sub