1

Can't quite figure this out and i'm sure it's a simple fix. I have a script that utilizes the AGSSOM tool. It first stops all published services, allows for databases to be tidied up by Compressing/Uncompresing and Compacting, then resarts the services. The script is a tool in a tool box. I'm currently trying to set a parameter where the user picks which geodatabases to clean up (our services use several geodatabases and they are constantly being manipulated). Within the Parameters tab of the scripts properties, I've added a parameter and assinged it to Data Element as the Data Type (anyone have a better suggestion?). Additionally, I've set the MultiValue to Yes. Here is an example of some of the code.

inGDB = gp.GetParameterAsText(0)
gp.CompressFileGeodatabaseData_management(inGDB)

When I load multiple GDBs It crashes whith an error:

 <class 'arcgisscripting.ExecuteError'>: Failed to execute. Parameters are not valid.
Input file geodatabase data: Dataset 'Z:\Data\Reference.gdb;Z:\Data\As-Built.gdb' does not exist
Failed to execute (CompressFileGeodatabaseData).

Failed to execute (ArcgisServerUpdater). 

If I load a single GDB It works.

3

CompressFileGeodatabaseData only accepts a single value for input, you need to split it up.

for inGDB in gp.GetParameterAsText(0).split(';'):
    gp.CompressFileGeodatabaseData_management(inGDB)

Changing YOUR tool's input to multivalue doesn't change the other tool you call's parameter to multivalue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.