laptop and a wrench

漏洞

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

上次发布: August 19, 2020 ArcGIS for Desktop
漏洞 ID 编号 NIM063236
已提交December 1, 2010
上次修改时间February 20, 2025
适用范围ArcGIS for Desktop
找到的版本10.0
编程语言VBA
操作系统Windows OS
操作系统版本7 64 Bit
状态Will Not Be Addressed

附加信息

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.

解决办法

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

重现步骤

漏洞 ID: NIM063236

软件:

  • ArcGIS for Desktop

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项