SubtypeFieldDescription Property
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();
}
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3.1 or higher.