Remove Subtype (Data Management)

Summary

Removes a subtype from the input table using its code.

Usage

Syntax

RemoveSubtype_management (in_table, subtype_code)
ParameterExplanationData Type
in_table

The feature class or table containing the subtype definition.

Table View
subtype_code
[subtype_code,...]

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

String

Code Sample

Remove Subtype Example (Python Window)

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

import arcpy
from arcpy import env
env.workspace =  "C:/data/Montgomery.gdb"
arcpy.RemoveSubtype_management ("water/fittings", ["4","7"])
Remove Subtype 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
#Author: ESRI

# Import system modules
import arcpy
from arcpy import env
 
try:
    # Set the workspace (to avoid having to type in the full path to the data every time)
    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)
 
except Exception, e:
    # If an error occurred, print line number and error message
    import traceback, sys
    tb = sys.exc_info()[2]
    print "Line %i" % tb.tb_lineno
    print e.message

Environments

Related Topics

Licensing Information

ArcView: Yes
ArcEditor: Yes
ArcInfo: Yes

10/27/2014