ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapMemberIDSet Class
Members Example

In This Topic
    MapMemberIDSet Class
    In This Topic
    A collection of mapMembers and their corresponding list of objectIDs to represent a set of rows or features.
    Object Model
    MapMemberIDSet ClassMapMemberIDSet Class
    Syntax
    public class MapMemberIDSet 
    Public Class MapMemberIDSet 
    Example
    Get records that are set as Root Nodes
    await QueuedTask.Run(() =>
    {
      MapMemberIDSet rootNodes = MapView.Active.GetRootNodes();
      var rootNodeDict = rootNodes.ToDictionary();
    
      // rootNodeDict is a Dictionary<MapMember, List<long>>
    
      // access a particular mapMember in the Dictionary
      if (rootNodeDict.ContainsKey(mapMember))
      {
        var oids = rootNodeDict[mapMember];
      }
    
      // OR iterate through the dictionary
      foreach (var (mm, oids) in rootNodeDict)
      {
        // do something
      }
    });
    
    Assign a set of records as Root Nodes
    await QueuedTask.Run(() =>
    {
      var dict = new Dictionary<MapMember, List<long>>();
      dict.Add(entityLayer, oids);
      MapMemberIDSet mmIDSet = MapMemberIDSet.FromDictionary(dict);
    
      MapView.Active.SetRootNodes(mmIDSet);
    });
    Assign a selection as Root Nodes
    await QueuedTask.Run(() =>
    {
      var mapSel = MapView.Active.Map.GetSelection();
    
      MapView.Active.SetRootNodes(mapSel);
    });
    Define and select a set of records as Root Nodes
    await QueuedTask.Run(() =>
    {
      var dict = new Dictionary<MapMember, List<long>>();
      dict.Add(entityLayer, oids);
      dict.Add(entityLayer2, oids2);
      MapMemberIDSet mmIDSet = MapMemberIDSet.FromDictionary(dict);
    
      MapView.Active.SelectRootNodes(mmIDSet);
    });
    
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Mapping.MapMemberIDSet
          ArcGIS.Desktop.Mapping.SelectionSet

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.4 or higher.
    See Also