laptop and a wrench

Bug

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

Last Published: August 19, 2020 ArcGIS for Desktop
Bug ID Number NIM063236
SubmittedDecember 1, 2010
Last ModifiedFebruary 20, 2025
Applies toArcGIS for Desktop
Version found10.0
Program languageVBA
Operating SystemWindows OS
Operating System Version7 64 Bit
StatusWill Not Be Addressed

Additional Information

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.

Workaround

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

Steps to Reproduce

Bug ID: NIM063236

Software:

  • ArcGIS for Desktop

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options