AnsweredAssumed Answered

Working with multivalue parameters in a custom toolbox

Question asked by simpson.ben1990 on Dec 16, 2015
Latest reply on Dec 16, 2015 by FGibson-esristaff



I am currently creating a custom toolbox which will run a script to append tables and feature classes from one personal geodatabase to another. Abit of background about these personal GDBs; they all have the exact same format in terms of the number of feature classes and tables, their objects names and the structure/type of tables/feature classes. You could think of these personal GDBs as regional databases. What I need to do is merge several of these GDBs into one GDB. What I am currently unsure about how to code is I want to create a python script to automate this process (which working on one GDB at a time is fine), specifically to run through multiple GDBs at a time.


So in my script I have a variable (Import_SIMCAT) which holds a list of the GDBs selected to be appended to, and I have a variable (Export_SIMCAT) which holds the GDBs being appended from. To make things less straight forward, I have a varying number of GDBs being appended/merged together, so one GDB may have only one other GDB being appended to it while another may have 5 GDBs being appended to it. The question I have is how in my script can I get my code to identify which GDBs need to be appended to which?


For example, lets say that I have 10 GDBs being appended to 4 GDBs. In the variable Import_SIMCAT I would have GDBs A,B,C,D while in variable Export_SIMCAT I would have GDBs E,F,G,H,I,J,K,L,M,N. I would want GDB E,F and G to be appended to GDB A, while GDB H to be appended to GDB B, while GDBs I,J,K and L to be appended to GDB C and finally GDBs M and N to be appended to GDB D.


I dont know if it is possible to make it so that the user can identify which GDBs are getting appended to which. At the moment I only know how to loop through the selected GDBs by using their index position within the list variable they are stored in. But that process doesnt work when I have different number of GDBs being appended.


I hope that makes sence. If it helps I can put a copy of my current script on here but as it currently stands it is very unformed and only creates variables for the two different parameters, splits them up into lists and removes the unwanted single quotes.


Thanks in advance for any help and advice anyone can provide on this topic.