Delete Coded Value from Domain (Data Management) |
|
Release 9.2
Last modified November 29, 2010 |
![]() ![]() ![]() Print all topics in : "Tools" |
Removes a value from a coded value domain.
Usage tips
Workspace domains can also be managed in ArcCatalog. Domains can be created and modified through the Domains tab on the Database Properties dialog box.
The Code Value parameter Add Value button is used only in ModelBuilder. In ModelBuilder, where the preceding tool has not been run, or its derived data does not exist, the Code Value parameter may not be populated with values. The Add Value button allows you to add expected values so you can complete the Delete Coded Value From Domain dialog and continue to build your model.
The environment settings do not have an effect on this tool.
Command line syntax
An overview of the Command Line window
DeleteCodedValueFromDomain_management <in_workspace> <domain_name> <code;code...>
Parameter | Explanation | Data Type |
<in_workspace> |
The workspace containing the domain to be updated. |
Workspace |
<domain_name> |
The name of the coded value domain to be updated. |
String |
<code;code...> |
The value(s) to be deleted from the specified domain. The Add Value button, which is used only in ModelBuilder, allows you to add expected value(s) so you can complete the dialog and continue to build your model. |
String |
workspace E:\arcgis\ArcTutor\BuildingaGeodatabase DeleteCodedValueFromDomain montgomery.mdb DistDiam "20;24"
Scripting syntax
About getting started with writing geoprocessing scripts
DeleteCodedValueFromDomain_management (in_workspace, domain_name, code)
Parameter | Explanation | Data Type |
in_workspace (Required) |
The workspace containing the domain to be updated. |
Workspace |
domain_name (Required) |
The name of the coded value domain to be updated. |
String |
code (Required) |
The value(s) to be deleted from the specified domain. The Add Value button, which is used only in ModelBuilder, allows you to add expected value(s) so you can complete the dialog and continue to build your model. |
String |
# Purpose: Update an attribute domain to constrain valid|material values # 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 = "E:/arcgis/ArcTutor/BuildingaGeodatabase" # Set variable for domain name domname = "Material" # Process: Remove the constraint from the material field gp.RemoveDomainFromField("Montgomery.mdb/Water/DistribMains", "MATERIAL") # Edit the domain values # Process: Remove a coded value from the domain gp.DeleteCodedValueFromDomain("Montgomery.mdb", domname, "ACP: Asbestos concrete") # Process: Create a table from the domain to edit it with ArcMap editing tools gp.DomainToTable("Montgomery.mdb", domname, "Montgomery.mdb/" + domname , "TYPE", "DESCRIPT") # Process: Delete the domain gp.DeleteDomain("Montgomery.mdb", domname) # Edit the domain table outside of geoprocessing # and then bring the domain back in with the TableToDomain process except: # If an error occurred while running a tool print the messages print gp.GetMessages()