Using Python Script in Model Builder:  How do I specify an output?

5084
2
11-18-2013 02:33 PM
GusGoodwin
New Contributor
Hi,

I'm trying to incorporate a python script that I found on this forum into ModelBuilder.  The script creates a wedge-shaped buffer for point data.  It creates a new shapefile in the same workspace as the point layer, but this does not appear as an output in ModelBuilder.  I would like it to appear so that I can link the output to the rest of my workflow. 

Most of the support I could find did not address scripts that created new feature classes.  Any suggestions would be welcome.  Thank you!
0 Kudos
2 Replies
T__WayneWhitley
Frequent Contributor
If the script is not already in the form of a script tool, i.e. it shows up in ArcToolbox in a custom toolbox, you can make it so.
I assume you already know how to make input/output parameters?  For example if you have an input parameter set to be received by the script (as in arcpy.GetParameterAsText...) then you'd define the script tool's parameters accordingly when you 'link' the script file to it's tool interface.  Then you should be able to enter it into your larger model, defining the param variables as you would a system tool, and linking them together in a process.

Maybe this is what you should review 1st:

What is a script tool?
Desktop » Geoprocessing » Creating tools
http://resources.arcgis.com/en/help/main/10.1/index.html#/What_is_a_script_tool/001500000006000000/


Hope that helps,
Wayne
0 Kudos
curtvprice
MVP Esteemed Contributor
I'm trying to incorporate a python script that I found on this forum into ModelBuilder.  The script creates a wedge-shaped buffer for point data.  It creates a new shapefile in the same workspace as the point layer, but this does not appear as an output in ModelBuilder.  I would like it to appear so that I can link the output to the rest of my workflow. 


If you set up the python script as a script tool with an output (or derived) parameter of type feature class, when you add that script tool to ModelBuilder, the output element should appear in the model.

(The way to set up output parameters is described there in the help section Wayne pointed you to.)
0 Kudos