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 have a script based gp tool published on web (via Flex App). The script goes to many different mxds to write a report.

Then I created another model to do some geoprocessing in a different toolbox and mxd. Now from the first published tool I want to combine one, so that the whole process will execute once called from Flex app.

Thanks

share|improve this question
    
Try that: import os os.system("yourscript.py" "argument1" "argument2") obviously if you don't have arguments, skip the last part. Never tried it, but I asked the question at ESRI's ArcPy course and that's what the teacher told me... (sorry for the formatting, my line breaks doesn't work...?) –  fgcartographix Aug 17 '12 at 19:43
    
I am trying to trigger the model from Python, but Obviously at the end I can export my model into script, but it brings all the hard coded paths.. But will try it. –  Deep Aug 17 '12 at 19:55
add comment

1 Answer

up vote 2 down vote accepted

To do this look at AddToolbox and/or ImportToolbox where it says:

While any of the core ArcGIS toolboxes are accessible by default in a script, your own custom or third-party toolboxes must be added using ImportToolbox to use them in a script.

I've pointed you at 10.1 documentation but have successfully published Geoprocessing Services at 10.0 from tools that call custom tools in my own toolboxes using the method described in the documentation.

share|improve this answer
    
Hi, Thanks for your response. it worked in Python. but I published this python script as geo-processing tool and it did not work. Any suggestion on this? –  Deep Sep 12 '12 at 17:59
    
It worked for one script added this way but not for other, so most likely it is my code. Thanks –  Deep Sep 12 '12 at 18:52
    
Its hard to comment without seeing more details but approach I would take is to try and get some skeleton scripts running that just run the overall process without having all the embellishments within them. Doing that may shed light on why full code is not behaving as desired. –  PolyGeo Sep 13 '12 at 10:32
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.