ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / KnowledgeGraphMappingExtensions Class / SetRootNodes Method
The set of root nodes. If the set is empty, then the root nodes are cleared.
Example Version

SetRootNodes Method
Sets the root nodes for the link chart map view. Use an empty set of rootNodes to clear the existing set of root nodes. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public static void SetRootNodes( 
   MapView mapView,
   MapMemberIDSet rootNodes
)

Parameters

mapView
rootNodes
The set of root nodes. If the set is empty, then the root nodes are cleared.
Exceptions
ExceptionDescription
Map cannot be null.
rootNodes cannot be null.
Map is not a link chart.
This method or property must be called within the lambda passed to QueuedTask.Run.
Example
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);
});
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3.4 or higher.
See Also