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.

  • 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

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.

  • 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

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.