Deleting selected elements based on AE

Source: Internet
Author: User
Delete selected elements based on AE --

'// 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 ("are you sure to delete all" & GeometryTypeStr & "elements? ", 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.