Set Subtype Field (Data Management) |
|
Release 9.2
Last modified November 29, 2010 |
![]() ![]() ![]() Print all topics in : "Tools" |
Defines the field in the input table or feature class that stores the subtype codes.
Learn more about working with subtypes
Usage tips
A feature class or table can have only one subtype field.
After a subtype field is set, subtype codes are added to the feature class or table with the Add Subtype function.
The subtypes of a feature class or table can also be managed in ArcCatalog. Subtypes can be created and modified using the Subtypes Property page on the dataset's Properties dialog box.
The environment settings do not have an effect on this tool.
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 |
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 |
# 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()