Show Navigation | Hide Navigation
You are here:
Geoprocessing tool reference > Data Management toolbox > Subtypes toolset > Tools

Add Subtype (Data Management)

Release 9.2
Last modified November 29, 2010
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Tools"


Related Topics

Adds a new subtype to the subtypes in the input table. A field in the feature class or table must be assigned as the subtype field before new subtypes can be added.

Learn more about working with subtypes


Usage tips

Command line syntax
An overview of the Command Line window
AddSubtype_management <in_table> <subtype_code> <subtype_description>

Parameter Explanation Data Type
<in_table>

The feature class or table containing the subtype definition to be updated.

Table View
<subtype_code>

A unique integer value for the subtype to be added.

Long
<subtype_description>

A description of the subtype code.

String
Data types for geoprocessing tool parameters


Command line example

workspace E:\arcgis\ArcTutor\BuildingaGeodatabase\Montgomery.mdb
SetSubtypeField water\fittings TYPECODE
AddSubtype water\fittings "1" "Bend"

Scripting syntax
About getting started with writing geoprocessing scripts
AddSubtype_management (in_table, subtype_code, subtype_description)

Parameter Explanation Data Type
in_table (Required)

The feature class or table containing the subtype definition to be updated.

Table View
subtype_code (Required)

A unique integer value for the subtype to be added.

Long
subtype_description (Required)

A description of the subtype code.

String

Data types for geoprocessing tool parameters


Script example

# Purpose: Create a subtype definition

# Create the Geoprocessor object
import arcgisscripting
gp = arcgisscripting.create()

try:
    # Set the workspace (to avoid having to type in the full path to the data every time)
    gp.Workspace =  "C:/arcgis/ArcTutor/BuildingaGeodatabase/Montgomery.mdb"

    # Process: Set Subtype Field...
    gp.SetSubtypeField("water/fittings", "TYPECODE")

    # Process: Add Subtypes...
    gp.AddSubtype("water/fittings", "0", "Unknown")
    gp.AddSubtype("water/fittings", "1", "Bend")
    gp.AddSubtype("water/fittings", "2", "Cap")
    gp.AddSubtype("water/fittings", "3", "Cross")
    gp.AddSubtype("water/fittings", "4", "Coupling")
    gp.AddSubtype("water/fittings", "5", "Expansion joint")
    gp.AddSubtype("water/fittings", "6", "Offset")
    gp.AddSubtype("water/fittings", "7", "Plug")
    gp.AddSubtype("water/fittings", "8", "Reducer")
    gp.AddSubtype("water/fittings", "9", "Saddle")
    gp.AddSubtype("water/fittings", "10", "Sleeve")
    gp.AddSubtype("water/fittings", "11", "Tap")
    gp.AddSubtype("water/fittings", "12", "Tee")
    gp.AddSubtype("water/fittings", "13", "Weld")
    gp.AddSubtype("water/fittings", "14", "Riser")

    # Process: Set Default Subtype...
    gp.SetDefaultSubtype("water/fittings", "4")

except:
    # If an error occurred while running a tool print the messages
    print gp.GetMessages()

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.