AnsweredAssumed Answered

How do I convert my python script to a tool in model builder?

Question asked by apmartincude on Aug 7, 2017
Latest reply on Aug 7, 2017 by kdunlop

There are multiple inputs in my code and I was wondering how I can have those inputs made within model builder. I am going to have many outputs so I am not interested in adding a code that makes an output block in the model builder, just inputs. For example, the code below. I want to write a code that would replace Flowaccumulation and Flowdirection as my inputs in the code because its just reading a file that I told it to. I want to replace it with code that I can manually put inputs in them through model builder. Please show me a code and not just a link. Thank you.

import arcpy
from arcpy.sa import *
from arcpy import env

Flowaccumulation="rC:\Temp\ARCGIS_PROJECT\Tutorial\LAYERS\dem_fa"
Flowdirection= "rC:\Temp\ARCGIS_PROJECT\Tutorial\LAYERS\dem_fd"

Outcomes