Answers for "Emptying and refilling a Geodatabase domainlist from excelfile" https://knowledge.亚搏在线safe.com/questions/86874/emptying-and-refilling-a-geodatabase-domainlist-fr.html The latest answers for the question "Emptying and refilling a Geodatabase domainlist from excelfile" Answer by lars_de_vries https://knowledge.亚搏在线safe.com/answers/86905/view.html

嗨,索菲亚,

For the filling the domain,I use a PythonCaller.I got the Python code fromthisArcGIS page:

import arcpyarcpy.env.workspace = "C:/data"arcpy.AddCodedValueToDomain_management("montgomery.gdb","material","1","PVC")

Emptying the domain can be done by either deleting it or by removing the coded values.The last step would require you to know all the present values.If you delete the domain,you'll also have to recreate it and assign it to the relevant field(s).

Since you manage the domain values in an Excel,I would suggest keeping the status of each coded value as well.This way you'll only have to take action on those values that need to be added,deleted or perhaps changed.

The code for removing coded values can be foundhere:

import arcpyarcpy.env.workspace = "C:/data"arcpy.DeleteCodedValueFromDomain_management("montgomery.gdb","DistDiam",["20","24"])

Wed,13 Feb 2019 17:34:40 GMT lars_de_vries