HOW TO
To use a script tool in ModelBuilder, the input and output parameters must be set. If there are no output parameters set in the script tool, the output result cannot be used in a different tool within ModelBuilder. This can be tricky, because the output location can be specified within a script, but the output result cannot be used. If the script tool without any output parameter is inserted in a model, the tool displays without any input or output available as shown in the image below.
This article provides steps to add an output parameter in a script tool for ModelBuilder.
import arcpy # Set local variables inFeatures = arcpy.GetParameter(0) outLocation = "C:/output.gdb" outFeatureClass = arcpy.GetParameter(1) # Execute the tool arcpy.FeatureClassToFeatureClass_conversion(inFeature, outLocation, outFeatureClass)
Get help from ArcGIS experts
Download the Esri Support App