描述
从要素类或表字段中移除属性域关联。
使用方法
- 此工具的作用与指定字段的属性域功能相反。从字段中移除属性域会一并移除字段和属性域之间的关联。 
- 从字段中移除属性域后,该字段的属性验证规则也将从数据库中移除。 
- 相同属性域可与同一个表、要素类或子类型的多个字段关联,也可以与多个表和要素类关联。从字段中移除属性域不会影响其他属性域关联。 
- 当前地图图层可能用于定义“输入”表。 
语法
arcpy.management.RemoveDomainFromField(in_table, field_name, {subtype_code})| 参数 | 说明 | 数据类型 | 
| in_table | 包含要移除的属性域的输入表。 | Table View | 
| field_name | 不再与属性域关联的字段。 | Field | 
| subtype_code [subtype_code,...] (可选) | 不再与属性域关联的子类型编码。 | String | 
派生输出
| 名称 | 说明 | 数据类型 | 
| out_table | 已更新的输入表。 | 表视图 | 
代码示例
以下 Python 窗口脚本演示了如何在即时模式下使用 RemoveDomainFromField 函数。
import arcpy
arcpy.env.workspace = "C:/data"
arcpy.RemoveDomainFromField_management("montgomery.gdb/water/distribmains", "DIAMETER")此独立脚本将 RemoveDomainFromField 函数用作编辑属性域的工作流的一部分。
# Name: RemoveDomainsExample.py
# Purpose: Update an attribute domain to constrain valid pipe material values
# Import system modules
import arcpy
import os
 
# Set the workspace (to avoid having to type in the full path to the data every time)
arcpy.env.workspace = "data"
 
# set local parameters
inFeatures = "Montgomery.gdb/Water/DistribMains"
inField = "MATERIAL"
dWorkspace = "Montgomery.gdb"
domName = "Material"
codedValue =  "ACP: Asbestos concrete"
codeField = "TYPE"
descField = "DESRIPT"
# Process: Remove the constraint from the material field
arcpy.RemoveDomainFromField_management(inFeatures, inField)
 
# Edit the domain values
# Process: Remove a coded value from the domain
arcpy.DeleteCodedValueFromDomain_management(dWorkspace, domName, codedValue)
 
# Process: Create a table from the domain to edit it with ArcMap editing tools
arcpy.DomainToTable_management(dWorkspace, domname, 
                               os.path.join(dWorkspace, domname), codeField, 
                               descField)
# Process: Delete the domain
arcpy.DeleteDomain_management(dWorkspace, domName)
 
# Edit the domain table outside of geoprocessing
# and then bring the domain back in with the TableToDomain process许可信息
- Basic: 是
- Standard: 是
- Advanced: 是