ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.KnowledgeGraph Namespace / KnowledgeGraphInvestigationView Class / GetSelectedRecords Method
Example

In This Topic
    GetSelectedRecords Method
    In This Topic
    Gets the selected records. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function GetSelectedRecords() As KnowledgeGraphLayerIDSet
    public KnowledgeGraphLayerIDSet GetSelectedRecords()

    Return Value

    A ArcGIS.Desktop.Mapping.KnowledgeGraphLayerIDSet representing the selected records.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Get Selected records and open in a new link chart
    {
      // get the active investigation view
      var iv = KnowledgeGraphInvestigationView.Active;
    
      await QueuedTask.Run(() =>
      {
        // get the investigation
        var inv = iv.Investigation;
    
        // get the set of selected records
        var idSet = iv.GetSelectedRecords();
    
        // view these records in a link chart
        var map = MapFactory.Instance.CreateLinkChart("myLinkChart", new Uri(inv.ServiceUri), idSet);
        ProApp.Panes.CreateMapPaneAsync(map);
      });
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.5 or higher.
    See Also