Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm currently testing a model with a large number of elements (about 400) which takes five input feature classes and three workspaces.

When I test it against my test data locations I can open up the tool dialog and it finds all my data in the test locations that I have set as defaults so quite quickly I can just hit OK to get the tool running.

However, when I move my test data to a new location to simulate what a user of the tool is likely to need to do, then it takes about 30 seconds to locate the data for each of the eight input fields i.e. 4 minutes in total with me having to wait in between.

What I would like to do is to locate the first dataset, and have my tool do something akin to project repair in an MXD which seems to assume that if one dataset moved from disk location A to disk location B then probably the rest did too.

Before I start to investigate writing Python code for tool validation that attempts to do this I am wondering if anybody else has already done so?

share|improve this question
1  
If you want to avoid all that geoprocessing validation overhead then convert/rewrite your model in Python. With 400 elements I am sure that there is a lot of room for refactoring, so a re-write may be best. –  blah238 Mar 6 '13 at 0:44
1  
Not sure I understand the whole situation, but if you were to just wrap your model with a script tool that calls it with your specific parameters, would that avoid the issue? –  blah238 Mar 6 '13 at 0:53
    
There is HUGE scope for refactoring to pure Python/ArcPy rather than the ModelBuilder/Python/ArcPy mix it currently is, because this is just one of about a dozen such models in this toolbox but getting paid to do it will be the hard part :-( I think your second comment will resolve my issue - am now in process of running it to Copy As Python Snippet, then putting an import arcpy and arcpy.AddToolbox in front should have it ready to run and change with simple Replace. I'll update you with result and if successful will ask you to copy your Comment as an Answer. –  PolyGeo Mar 6 '13 at 1:22
2  
Wrapping the model with a script tool that calls it with your specific parameters is able to avoid the need for me to project repair so if you make it an Answer then I will Accept. Thanks for saving me the development time by suggesting a more practical solution. –  PolyGeo Mar 6 '13 at 3:25
add comment

1 Answer

up vote 2 down vote accepted

You might be able to avoid the issue if you were to just wrap your model with a script tool that calls it with your specific parameters.

See the help on ImportToolbox for an example.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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