public static KnowledgeGraphInvestigationView Active {get;}
Public Shared ReadOnly Property Active As KnowledgeGraphInvestigationView
public static KnowledgeGraphInvestigationView Active {get;}
Public Shared ReadOnly Property Active As KnowledgeGraphInvestigationView
// access the currently active knowledge graph investigation view KnowledgeGraphInvestigationView activeView = KnowledgeGraphInvestigationView.Active; KnowledgeGraphInvestigation investigation = activeView?.Investigation; if (investigation != null) { // perform some action }
// get the active investigation view var iv = KnowledgeGraphInvestigationView.Active; // clear any TOC selection iv.ClearTOCSelection(); // select entities List<string> entities = new List<string>(); entities.Add("Person"); entities.Add("Org"); iv.SelectEntities(entities); // or select relationships List<string> relationships = new List<string>(); relationships.Add("HasEmployee"); iv.SelectRelationships(relationships); // or select a combination List<string> namedObjectTypes = new List<string>(); namedObjectTypes.Add("Person"); namedObjectTypes.Add("Org"); namedObjectTypes.Add("HasEmployee"); iv.SelectNamedObjectTypes(namedObjectTypes);
// get the active investigation view var iv = KnowledgeGraphInvestigationView.Active; var serviceUri = iv.Investigation.ServiceUri; // build a dictionary of records var dict = new Dictionary<string, List<long>>(); //Each entry consists of the type name and corresponding lists of ids dict.Add(first_entity, new List<long>() { 1, 5, 18, 36, 78 }); //Create the id set... var idSet = KnowledgeGraphLayerIDSet.FromDictionary(new Uri(serviceUri), dict); // select the records on the investigation view iv.SetSelectedRecords(idSet, SelectionCombinationMethod.New);
// get the active investigation view var iv = KnowledgeGraphInvestigationView.Active; 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); });
Target Platforms: Windows 11, Windows 10