Show Navigation | Hide Navigation
You are here:
Geoprocessing tool reference > Data Management toolbox > Domains toolset > Tools

Delete Domain (Data Management)

Release 9.2
Last modified November 29, 2010
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Tools"


Related Topics

Deletes a domain from a workspace.


Usage tips

Command line syntax
An overview of the Command Line window
DeleteDomain_management <in_workspace> <domain_name>

Parameter Explanation Data Type
<in_workspace>

The geodatabase that contains the domain to be deleted.

Workspace
<domain_name>

The name of the domain to be deleted.

String
Data types for geoprocessing tool parameters


Command line example

workspace E:\arcgis\ArcTutor\BuildingaGeodatabase
DeleteDomain_management montgomery.mdb DistDiam

Scripting syntax
About getting started with writing geoprocessing scripts
DeleteDomain_management (in_workspace, domain_name)

Parameter Explanation Data Type
in_workspace (Required)

The geodatabase that contains the domain to be deleted.

Workspace
domain_name (Required)

The name of the domain to be deleted.

String

Data types for geoprocessing tool parameters


Script example

# 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()

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.