4

Is it possible to get the exact Python code corresponding to a specific run of a tool in ArcToolbox?

The reason I ask is that I want to replicate the function in a Tool in Python, and adapt it to my needs.

I have tried some md tool for ncdf, which works in the GUI but not in python if I write the Python code by hand.

0

3 Answers 3

11

After running the tool navigate to the 'Results' window (which can be found under the Geoprocessing menu), right click on the process and select "Copy As Python Snippet".

enter image description here

0
4

You can use ModelBuilder to configure your algorithm, drag & drop the tools that you need from the toolbox. Configure the inputs and outputs, and then in the ModelBuilder window export to Python.

enter image description here

0

Tools can be added to ModelBuilder and exported as Python code. It is a technique I have often used to replicate tools in Python.

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.