How to delete the vertex in arcmap using

02-19-2016 04:38 AM
New Contributor

Dear all,

         I am using arcmap 9.3 and i need to delete the vertex pragmatically. i have the feature and index of delete vertex but i dont know how to delete the vertex any one give me the sample code for delete vertex. i am using following code its not working.

  Function deletevertex(ByVal index As Integer, ByVal pointCollection As IPointCollection)

        Dim editorUID As UID

        editorUID = New UID

        editorUID.Value = "esriEditor.Editor"

        Dim editor As IEditor

        editor = (papp.FindExtensionByCLSID(editorUID))

        Dim editSketch As IEditSketch

        If editor Is Nothing Then

            Exit Function

        End If

        editSketch = CType(editor, IEditSketch)

        If index = -1 Then

        End If

        Dim sketchOperation As ISketchOperation

        sketchOperation = New SketchOperation

        sketchOperation.MenuString_2 = "Delete Vertex"


        pointCollection = editSketch.Geometry

        pointCollection.RemovePoints(index, 1)




    End Function

above code show the error of

"the index either too small or too large".


If i am select the Feature using "modifying Feature" that time vertex deleted successfully. if i am select the vertex using "new feature creation " that time only the index either too large or too small error showing.

0 Kudos
0 Replies