laptop and a wrench

Bogue

IGraphicsContainerSelect::ElementSelectionCount property returns the count of all selected graphic elements in all layers.

Dernière publication: August 19, 2020 ArcGIS for Desktop
Numéro d’ID de bogue NIM063236
EnvoiDecember 1, 2010
Dernière modificationFebruary 20, 2025
S’applique àArcGIS for Desktop
Version trouvée10.0
Langue du programmeVBA
Système d’exploitationWindows OS
Version du système d’exploitation7 64 Bit
StatutWill Not Be Addressed

Informations supplémentaires

We apologize that we were unable to address this issue within the current product support cycle.  If the issue continues to affect your work in a supported release, please contact Technical Support.

Solution de contournement

Cast ActiveGraphicsLayer to IGraphicsContainer and loop through the elements to validate if they are selected or not.Sub SelectionCount() Dim pMxDocument As IMxDocument Set pMxDocument = ThisDocument Dim gc As IGraphicsContainer Set gc = pMxDocument.FocusMap.ActiveGraphicsLayer Dim pGraphicsContainerSelect As IGraphicsContainerSelect Set pGraphicsContainerSelect = gc gc.Reset Dim elem As IElement Set elem = gc.Next() Dim x As Integer x = 0 Do While Not elem Is Nothing If (pGraphicsContainerSelect.ElementSelected(elem) = True) Then x = x + 1 End If Set elem = gc.Next() Loop MsgBox pMxDocument.FocusMap.ActiveGraphicsLayer.Name & " is selected" & x & " elements" pMxDocument.ActiveView.RefreshEnd Sub

Étapes pour reproduire

ID de bogue: NIM063236

Logiciel:

  • ArcGIS for Desktop

Recevoir une notification lorsque le statut d’un bogue change

Télécharger l’application Esri Support

En savoir plus sur ce sujet

Obtenir de l’aide auprès des experts ArcGIS

Contacter le support technique

Télécharger l’application Esri Support

Accéder aux options de téléchargement