Remove Subtype (Data Management)

Summary

Removes a subtype from the input table using its code.

Usage

  • Subtypes are removed using their integer code.

  • You can also view and manage subtypes in Subtypes view which can be opened by clicking the Subtypes button found in the Design section of the Data ribbon, or the by clicking the Subtypes button on the Fields view ribbon.

Syntax

arcpy.management.RemoveSubtype(in_table, subtype_code)
ParameterExplanationData Type
in_table

The feature class or table containing the subtype definition.

Table View
subtype_code
[subtype_code,...]

The subtype code to remove a subtype from the input table or feature class.

String

Derived Output

NameExplanationData Type
out_table

The updated table or feature class.

Table View

Code sample

RemoveSubtype example (Python window)

The following Python window script demonstrates how to use the RemoveSubtype function in immediate mode.

import arcpy
arcpy.env.workspace =  "C:/data/Montgomery.gdb"
arcpy.RemoveSubtype_management ("water/fittings", ["4","7"])
RemoveSubtype example 2 (stand-alone script)

The following stand-alone script demonstrates how to use the RemoveSubtype function as part of a workflow to remove subtypes from a subtype definition.

#Name: RemoveSubtype.py
# Purpose: Remove subtypes from a subtype definition

# Import system modules
import arcpy
 
# Set the workspace (to avoid having to type in the full path to the data every time)
arcpy.env.workspace =  "C:/data/Montgomery.gdb"
  
# Set local parameters
inFeatures = "water/fittings"
stypeList = ["5", "6", "7"]
 
# Process: Remove Subtype Codes...
arcpy.RemoveSubtype_management(inFeatures, stypeList)

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics