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

Set Subtype Field (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

Defines the field in the input table or feature class that stores the subtype codes.

Learn more about working with subtypes


Usage tips

Command line syntax
An overview of the Command Line window
SetSubtypeField_management <in_table> <field>

Parameter Explanation Data Type
<in_table>

The input table or feature class to which you want to add a subtype.

Table View
<field>

A field of type "Short Integer" or "Long Integer" to store the subtype codes.

Field
Data types for geoprocessing tool parameters


Command line example

workspace E:\arcgis\ArcTutor\BuildingaGeodatabase\Montgomery.mdb
SetSubtypeField water\fittings TYPECODE

Scripting syntax
About getting started with writing geoprocessing scripts
SetSubtypeField_management (in_table, field)

Parameter Explanation Data Type
in_table (Required)

The input table or feature class to which you want to add a subtype.

Table View
field (Required)

A field of type "Short Integer" or "Long Integer" to store the subtype codes.

Field

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.