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

In This Topic
    SubtypeFieldDescription Property
    In This Topic
    Syntax
    public SubtypeFieldDescription SubtypeFieldDescription {get; set;}
    Public Property SubtypeFieldDescription As SubtypeFieldDescription
    Exceptions
    ExceptionDescription
    The SubtypeFieldDescription does not exist in the TableDescription's list of FieldDescription objects.
    Example
    Removing subtype field designation
    public 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
    public 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, Windows 10

    ArcGIS Pro version: 3.1 or higher.
    See Also