Codierten Wert aus Domäne löschen (Data Management)

Diese ArcGIS 2.7-Dokumentation wurde archiviert und wird nicht mehr aktualisiert. Inhalt und Links sind möglicherweise veraltet. Verwenden Sie die aktuelle Dokumentation.

Zusammenfassung

Entfernt einen Wert aus einer Domäne mit codierten Werten.

Verwendung

Syntax

arcpy.management.DeleteCodedValueFromDomain(in_workspace, domain_name, code)
ParameterErklärungDatentyp
in_workspace

Der Workspace, in dem sich die zu aktualisierende Domäne befindet.

Workspace
domain_name

Der Name der Domäne mit codierten Werten, die aktualisiert werden soll.

String
code
[code,...]

Die Werte, die aus der angegebenen Domäne gelöscht werden sollen.

String

Abgeleitete Ausgabe

NameErklärungDatentyp
out_workspace

Der aktualisierte Eingabe-Workspace.

Workspace

Codebeispiel

DeleteCodedValueFromDomain – Beispiel 1 (Python-Fenster)

Das folgende Skript für das Python-Fenster veranschaulicht, wie die Funktion DeleteCodedValueFromDomain im unmittelbaren Modus verwendet wird.

import arcpy
arcpy.env.workspace =  "C:/data"
arcpy.DeleteCodedValueFromDomain_management("montgomery.gdb", "DistDiam", ["20","24"])
DeleteCodedValueFromDomain – Beispiel 2 (eigenständiges Skript)

In diesem eigenständigen Skript wird die Funktion DeleteCodedValueFromDomain als Teil eines Workflows verwendet, um eine Domäne zu bearbeiten.

# 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

Lizenzinformationen

  • Basic: Ja
  • Standard: Ja
  • Advanced: Ja

Verwandte Themen