You could also use "pMxdoc.FocusMap.SelectionCount"
Private Sub main() Dim pMxdoc As IMxDocument Set pMxdoc = ThisDocument If pMxdoc.FocusMap.SelectionCount = 0 Then MsgBox "No feature selected...Exiting" Exit Sub End If Dim pEnumFeature As IEnumFeature Set pEnumFeature = pMxdoc.FocusMap.FeatureSelection Dim pF As IFeature Set pF = pEnumFeature.Next Do Until pF Is Nothing ''do something with each feature Set pF = pEnumFeature.Next Loop End Sub
Dim pDisplayTable As IDisplayTable Set pDisplayTable = pFeatLayer Dim pSelSet As ISelectionSet Set pSelSet = pDisplayTable.DisplaySelectionSet Dim pCount As Integer pCount = pSelSet.count If pCount = 0 Then MsgBox "Nothing Selected" Exit Sub End If
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.