Private Sub PointsToPol()
Dim pDataset As IDataset, s As String
Dim pEditor As IEditor
Dim pFLayer As IFeatureLayer
Dim pFClass As IFeatureClass
Dim pFeat As IFeature
Dim pPrj As IPoint
Set pEditor = glEditor
Set pFLayer = ' Полигональный слой
If pFLayer Is Nothing Then Exit Sub
If Not pEditor.EditState = esriStateEditing Then
Set pDataset = pFLayer
pEditor.StartEditing pDataset.Workspace
pEditor.StartOperation
End If
Set pFClass = pFLayer.FeatureClass
Dim i As Long
Dim X As Double, Y As Double
On Error GoTo err
For i = 1 To ' количество точек
Set pFeat = pFClass.CreateFeature
X = значение Х
Y = значение Y
Set pPrj = New Point
pPrj.PutCoords Y, X
Set pFeat.Shape = pPrj
pFeat.Store
Set pPrj = Nothing
Next
pEditor.StopOperation "ввод точек вручную"
pEditor.StopEditing True
If Not pMxDoc Is Nothing Then
pMxDoc.ActiveView.Refresh
End If
On Error GoTo 0
Exit Sub
err:
MsgBox "Ошибка при занесении точек:" & vbCrLf & err.Description & " [" & err.Number & "]", vbCritical, "Ввод точек"
End Sub