ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data.DDL Namespace / TableDescription Class / SubtypeFieldDescription Property
Example

In This Topic
    SubtypeFieldDescription Property
    In This Topic
    Syntax
    Public Property SubtypeFieldDescription As SubtypeFieldDescription
    public SubtypeFieldDescription SubtypeFieldDescription {get; set;}
    Exceptions
    ExceptionDescription
    The SubtypeFieldDescription does not exist in the TableDescription's list of FieldDescription objects.
    Example
    Removing subtype field designation
    {
      // Must be called within QueuedTask.Run
      void DeleteSubtypeField(SchemaBuilder schemaBuilder, FeatureClassDefinition featureClassDefinition)
      {
        FeatureClassDescription featureClassDescription = new FeatureClassDescription(featureClassDefinition);
    
        // Set subtype field to null to remove the subtype field designation 
        featureClassDescription.SubtypeFieldDescription = null;
    
        schemaBuilder.Modify(featureClassDescription);
        schemaBuilder.Build();
      }
    }
    Modifying subtypes
    {
      // Must be called within QueuedTask.Run
      void ModifySubtypes(SchemaBuilder schemaBuilder, TableDefinition tableDefinition)
      {
        TableDescription tableDescription = new TableDescription(tableDefinition);
    
        // Remove the first subtype from the table
        IReadOnlyList<Subtype> subtypes = tableDefinition.GetSubtypes();
        tableDescription.SubtypeFieldDescription.Subtypes.Remove(subtypes.First().GetCode());
    
        // Adding a new subtype, 'Utility', in the existing table
        tableDescription.SubtypeFieldDescription.Subtypes.Add(4, "Utility");
    
        // Assigning 'Utility' subtype as the default subtype
        tableDescription.SubtypeFieldDescription.DefaultSubtypeCode = 4;
    
        schemaBuilder.Modify(tableDescription);
        schemaBuilder.Build();
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.1 or higher.
    See Also