選択フィーチャの OID 群を取得する方法

投稿日:2016/9/1 (木) 更新日:

''' <summary>
''' フィーチャ レイヤの選択フィーチャOID群の取得
''' </summary>
''' <param name="pFeatureLayer">FeatureLayer</param>
''' <returns>List(Of Long)</returns>
''' <remarks>.NET FrameworkのList型でOIDを返す</remarks>
Private Function GetSelectedOIDs(ByVal pFeatureLayer As IFeatureLayer) As List(Ong)
    Dim pFeatureSelection As IFeatureSelection = CType(pFeatureLayer, IFeatureSeion)
    Dim pSelectionSet As ISelectionSet = pFeatureSelection.SelectionSet
 
    Dim pEnumIDs As IEnumIDs = pSelectionSet.IDs
    pEnumIDs.Reset()                '
    Dim o As Long = pEnumIDs.Next()
    Dim array As New List(Of Long)  'List()にOID群を格納
    Do Until o = -1
        array.Add(o)
        o = pEnumIDs.Next()
    Loop
 
    Return array
End Function

関連記事

-プログラミング, ArcGIS
-, ,

Copyright© WINGFIELD since1981 , 2018 All Rights Reserved.