您的位置:首页 > 其它

基于AE删除选择的要素-

2007-05-31 11:10 323 查看
' //Deletes all features selected on the current layer
Public Sub DeleteAllSelectedFeatures(ByVal pFeatureCursor As IFeatureCursor, ByVal GeometryTypeStr As String)
Dim pWorkspaceEdit As IWorkspaceEdit
Dim pFeature As IFeature
' If there are no features currently selected then nothing to do
If pFeatureCursor Is Nothing Then Exit Sub
Try
Dim bResponse As DialogResult
bResponse = MsgBox("您确定删除所有" & GeometryTypeStr & "要素吗?", MessageBoxButtons.YesNo)
If bResponse = Windows.Forms.DialogResult.Yes Then
' Loop over the selected features deleting each in turn
pWorkspaceEdit = pSdeWorkspace
pWorkspaceEdit.StartEditing(True)
pWorkspaceEdit.StartEditOperation()
pFeature = pFeatureCursor.NextFeature
While Not pFeature Is Nothing
pFeature.Delete()
pFeature = pFeatureCursor.NextFeature
End While
pWorkspaceEdit.StopEditOperation()
pWorkspaceEdit.StopEditing(True)
End If
mainForm1.AxMapControl1.ActiveView.Refresh()
Exit Sub
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: