Select to view content in your preferred language

Python list to MultiValue output parameter

2662
4
04-21-2011 03:13 AM
MarcFasel
Deactivated User
Hello, how can I transfer objects of a Python list into a MultiValue output parameter?

The code I've written so far (below) put a complete list of layers objects in one row of the MultiValue output parameter but I'd like that each layer to be defined in one particular row:

listOfClippedOutputLayers = []

listInputFC = allInputFC.split(";")

for inFC in listInputFC:
    (inPath, inFC) = os.path.split(inFC)

    # [...] Clipping

    layer = arcpy.MakeFeatureLayer_management(clippedFC, clippedFCLayer)

    listOfClippedOutputLayers.append(layer)

arcpy.SetParameter(3, listOfClippedOutputLayers)


Does anyone know how to do this "transfer"?

Thanks for your help!

Marc
Tags (2)
0 Kudos
4 Replies
GaryBushek
Deactivated User
Have you figured this out? Im looking to doing the same thing.

thanks
0 Kudos
BruceNielsen
Frequent Contributor
Since a multivalue input parameter is a text string delimited by semicolons, I would think the output parameter would be the same. In theory, you should be able to create the appropriate output with the following change to the example code:
arcpy.SetParameter(3, ';'.join(listOfClippedOutputLayers))
0 Kudos
MarcFasel
Deactivated User
Hi Gary, I finally used another solution as MultiValue is not supported for geoprocessing output parameter. Sorry, maybe Bruce's solution works, I didn't try it.
0 Kudos
NobbirAhmed
Esri Alum
Yes, Bruce Nielsen's approach works. Thanks Bruce.
0 Kudos