移除子类型 (Data Management)

许可等级:BasicStandardAdvanced

摘要

使用子类型编码从输入表中移除子类型。

用法

语法

RemoveSubtype_management (in_table, subtype_code)
参数说明数据类型
in_table

包含子类型定义的要素类或表。

Table View
subtype_code
[subtype_code,...]

用于从输入表或要素类中移除子类型的编码。

String

代码实例

移除子类型示例(Python 窗口)

以下 Python 窗口脚本演示了如何在立即模式下使用 RemoveSubtype 函数。

import arcpy from arcpy import env env.workspace =  "C:/data/Montgomery.gdb" arcpy.RemoveSubtype_management ("water/fittings", ["4","7"])
移除子类型示例 2(独立脚本)

以下独立脚本演示了如何将 RemoveSubtype 函数用作从子类型定义中移除子类型的工作流的一部分。

#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

环境

相关主题

许可信息

ArcGIS for Desktop Basic: 是
ArcGIS for Desktop Standard: 是
ArcGIS for Desktop Advanced: 是
5/10/2014