ArcGIS Pro 3.5 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / SelectionSet Class / FromDictionary Method / FromDictionary<T>(Dictionary<T,List<Int64>>) Method
The collection of mapMembers and their corresponding objectIDs
Example

In This Topic
    FromDictionary<T>(Dictionary<T,List<Int64>>) Method
    In This Topic
    Creates a SelectionSet object from the dictionary of records.
    Syntax
    public new static SelectionSet FromDictionary<T>( 
       Dictionary<T,List<long>> dict
    )
    where T: MapMember
    Public Overloads Shared Shadows Function FromDictionary(Of T As MapMember)( _
       ByVal dict As Dictionary(Of T,List(Of Long)) _
    ) As SelectionSet

    Parameters

    dict
    The collection of mapMembers and their corresponding objectIDs

    Type Parameters

    T

    Return Value

    A SelectionSet
    Example
    Translate From Dictionary to SelectionSet
    //Create a selection set from a list of object ids
    //using FromDictionary
    var addToSelection = new Dictionary<MapMember, List<long>>();
    addToSelection.Add(us_zips_layer, new List<long> { 1506, 2696, 2246, 1647, 948 });
    var selSet =  ArcGIS.Desktop.Mapping.SelectionSet.FromDictionary(addToSelection);
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also