ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / KnowledgeGraphLayerIDSet Class / NamedObjectTypeCount Property
Example

In This Topic
    NamedObjectTypeCount Property (KnowledgeGraphLayerIDSet)
    In This Topic
    Gets the count of named object types in the ID set.
    Syntax
    Public ReadOnly Property NamedObjectTypeCount As Integer
    public int NamedObjectTypeCount {get;}
    Example
    Get the ID Set of a KG layer
    {
            await QueuedTask.Run(() =>
    {
      var idSet = kgLayer.GetIDSet();
    
      // is the set empty?
      var isEmpty = idSet.IsEmpty;
      // get the count of named object types
      var countNamedObjects = idSet.NamedObjectTypeCount;
      // does it contain the entity "Species";
      var contains = idSet.Contains("Species");
    
      // get the idSet as a dictionary of namedObjectType and oids
      var oidDict = idSet.ToOIDDictionary();
      var speciesOIDs = oidDict["Species"];
    
      // alternatively get the idSet as a dictionary of 
      // namedObjectTypes and uuids
      var uuidDict = idSet.ToUIDDictionary();
      var speciesUuids = uuidDict["Species"];
    
    });
          }
    Requirements

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

    ArcGIS Pro version: 3.3 or higher.
    See Also