Is there a way around that I can copy code value to Domain to multiple geodatabases ? Right now I had to do it by one at a time.
Thanks,
Robert
Copy values to Domain to mutilpule geodatabase
Started by
Robert2009
, Nov 01 2010 03:22 PM
3 replies to this topic
#1
Posted 01 November 2010 - 03:22 PM
#2
Posted 02 November 2010 - 03:23 AM
Just a quick thinking,Is there a way around that I can copy code value to Domain to multiple geodatabases ? Right now I had to do it by one at a time.
Thanks,
Robert
- prepare a table of code value domain in dbf format
- Put all Geodatabases into one folder
- use Python scripting with a loop function and TableToDomain tool
See a quick modified script from ArcGIS help below:
# Purpose: Update an attribute domain to constrain valid pipe 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 = r"C:\FolderOfGeodatabases"
ListOfGeo = gp.listworkspaces("","Access")
for Geo in ListOfGeo:
gp.TableToDomain("diameter.dbf", "code", "descript", Geo, "diameters", "Valid pipe diameters")
except:
# If an error occurred while running a tool, print the messages.
print gp.GetMessages()Hope this helps!
#3
Posted 02 November 2010 - 09:01 AM
Is this for personal or file geodatabase and yes i have them in one folder. How do I run this script in python ?
Thanks.
Thanks.
#4
Posted 02 November 2010 - 12:08 PM
"Access" means Personal Geodatabase. Basically, the script is correct but you have to modify some inputs such as name of table, code value.Is this for personal or file geodatabase and yes i have them in one folder. How do I run this script in python ?
Thanks.
ESRI writes help documents very well, you can check them for more details.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users


Sign In
Create Account

United States
Back to top
Vietnam








