Add Subtype (Data Management) |
|
Release 9.2
Last modified November 29, 2010 |
![]() ![]() ![]() Print all topics in : "Tools" |
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
A field in the feature class or table must be assigned as the subtype field before new subtypes can be added. This is done using the Set Subtype Field Set Subtype Field tool.
If you add a subtype whose code already exists, the new subtype will be ignored.
If you need to change the description of an existing subtype, you would first have to remove the subtype, then add a new subtype with the same code and a new description.
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
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 |
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 |
# 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()