How can I use a multivalue output parameter with ArcPy?

Please give an example.

  • This sounds like a pure Python question. Would you like to migrate it to SO? – whuber May 7 '11 at 17:46
  • 2
    No, arcpy is specific to ArcGIS. An example would be the results of a ListFeatureClasses as shown in the help files help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//… but I am almost convinced that is now what is being sought since there are dozens of examples of multivalued outputs, no even SetParameterAsText would qualify – user681 May 7 '11 at 18:42
  • @Dan Sure, Arcpy is part of ArcGIS. But isn't a multivalued output really just a matter of standard Python syntax? – whuber May 7 '11 at 20:02
  • 1
    There is a question on esri forums forums.arcgis.com/threads/… (with no answer). Could you add some code to make it a little clearer? I'm not sure I understand the question still (having read this one, and the esri forum one) – djq May 8 '11 at 13:22
  • 3
    @celenius Thank you: the ESRI forums question at least clears up my confusion: 'multivalue' is an ESRI construct. – whuber May 8 '11 at 14:12

Not sure how to credit this to Bruce Nielsen but his answer at the ArcGIS Discussion Forum seems to have been accepted there.

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))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.