0

In ArcGIS 10.5, I have the following script which grabs the files from a geodatabase and merges them into one layer:

import arcpy


# specify the path to the GDB with the asset files
#make sure the path uses '/' and NOT '\'
arcpy.env.workspace = 'path/example.gdb'
arcpy.env.overwriteOutput = True


# collects all the Feature Classes in the GDB
fcs = arcpy.ListFeatureClasses()

# run the Merge tool
arcpy.Merge_management (inputs=fcs, output='merge_result')

I added the script to my toolbox as 'Merge'. I then go on to add the script to my model, where I need to use the 'merge_result' output for other processes. However, when I add the script to the model, there is not 'output nodule' which I can connect to the other processes (such as Intersect, seen below). How would I go about adding an output nodule to this?

enter image description here

1 Answer 1

2

To specify the output you'll want to use either arcpy.SetParameter() or arcpy.SetParameterAsText() depending if you want to output an object or return text.

I am guessing you want to use the filename of your merged feature class so I would add the following line to the end of your script:

arcpy.SetParameterAsText(1, 'merge_result')

Also, check this answer: Adding output parameter to Python script tool?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.