<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to use a multiValue parameter? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-use-a-multivalue-parameter/m-p/1182140#M64752</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I want to make a python script where I put for input multiple layer's and to apply a buffer for every input. I want every buffer to put another distance. After I put the input layer's to appear another window where to specify the distance for buffer. It's possible?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;class Toolbox(object):&lt;BR /&gt;def __init__(self):&lt;BR /&gt;"""Define the toolbox (the name of the toolbox is the name of the&lt;BR /&gt;.pyt file)."""&lt;BR /&gt;self.label = "Toolbox"&lt;BR /&gt;self.alias = "toolbox"&lt;BR /&gt;# List of tool classes associated with this toolbox&lt;BR /&gt;self.tools = [Tool]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;class Tool(object):&lt;BR /&gt;def __init__(self):&lt;BR /&gt;"""Define the tool (tool name is the name of the class)."""&lt;BR /&gt;self.label = "Tool"&lt;BR /&gt;self.description = ""&lt;BR /&gt;self.canRunInBackground = False&lt;/P&gt;&lt;P&gt;def getParameterInfo(self):&lt;BR /&gt;"""Define parameter definitions"""&lt;BR /&gt;Layers=arcpy.Parameter(&lt;BR /&gt;displayName="Layers",&lt;BR /&gt;name="Layer",&lt;BR /&gt;direction="Input",&lt;BR /&gt;parameterType="Required",&lt;BR /&gt;datatype="GPFeatureLayer",&lt;BR /&gt;multiValue="True")&lt;BR /&gt;parameter = [Layers]&lt;BR /&gt;return parameter&lt;/P&gt;&lt;P&gt;def execute(self, parameter, messages):&lt;BR /&gt;"""The source code of the tool."""&lt;BR /&gt;parameter=params[0].valueAsText&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OctavianAndronache_0-1654957687355.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43287i39B17687FC73D9FC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="OctavianAndronache_0-1654957687355.png" alt="OctavianAndronache_0-1654957687355.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 11 Jun 2022 14:29:01 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2022-06-11T14:29:01Z</dc:date>
    <item>
      <title>How to use a multiValue parameter?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-a-multivalue-parameter/m-p/1182140#M64752</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I want to make a python script where I put for input multiple layer's and to apply a buffer for every input. I want every buffer to put another distance. After I put the input layer's to appear another window where to specify the distance for buffer. It's possible?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;class Toolbox(object):&lt;BR /&gt;def __init__(self):&lt;BR /&gt;"""Define the toolbox (the name of the toolbox is the name of the&lt;BR /&gt;.pyt file)."""&lt;BR /&gt;self.label = "Toolbox"&lt;BR /&gt;self.alias = "toolbox"&lt;BR /&gt;# List of tool classes associated with this toolbox&lt;BR /&gt;self.tools = [Tool]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;class Tool(object):&lt;BR /&gt;def __init__(self):&lt;BR /&gt;"""Define the tool (tool name is the name of the class)."""&lt;BR /&gt;self.label = "Tool"&lt;BR /&gt;self.description = ""&lt;BR /&gt;self.canRunInBackground = False&lt;/P&gt;&lt;P&gt;def getParameterInfo(self):&lt;BR /&gt;"""Define parameter definitions"""&lt;BR /&gt;Layers=arcpy.Parameter(&lt;BR /&gt;displayName="Layers",&lt;BR /&gt;name="Layer",&lt;BR /&gt;direction="Input",&lt;BR /&gt;parameterType="Required",&lt;BR /&gt;datatype="GPFeatureLayer",&lt;BR /&gt;multiValue="True")&lt;BR /&gt;parameter = [Layers]&lt;BR /&gt;return parameter&lt;/P&gt;&lt;P&gt;def execute(self, parameter, messages):&lt;BR /&gt;"""The source code of the tool."""&lt;BR /&gt;parameter=params[0].valueAsText&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OctavianAndronache_0-1654957687355.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43287i39B17687FC73D9FC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="OctavianAndronache_0-1654957687355.png" alt="OctavianAndronache_0-1654957687355.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jun 2022 14:29:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-a-multivalue-parameter/m-p/1182140#M64752</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-06-11T14:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a multiValue parameter?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-a-multivalue-parameter/m-p/1182153#M64753</link>
      <description>&lt;P&gt;You could use a ValueTable with one column for the layers and one for the buffer distance&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/2.8/arcpy/geoprocessing_and_python/defining-parameters-in-a-python-toolbox.htm#:~:text=is%20illustrated%20below.-,Creating%20value%20table%20parameters,-Some%20parameters%2C%20called" target="_blank" rel="noopener"&gt;Creating value table parameters&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    def getParameterInfo(self):
        """Define parameter definitions"""
        params = []
        param = arcpy.Parameter(
            displayName='Buffer Layer',
            name='buffer',
            datatype='GPValueTable',
            parameterType='Required',
            direction='Input')

        param.columns = [['GPFeatureLayer', 'Input Features'], ['GPDouble', 'Buffer Distance']]
        params.append(param)
        return params&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Luke_Pinner_0-1655158548458.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43368i343DBC387D9D45C8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Luke_Pinner_0-1655158548458.png" alt="Luke_Pinner_0-1655158548458.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 22:15:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-a-multivalue-parameter/m-p/1182153#M64753</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2022-06-13T22:15:57Z</dc:date>
    </item>
  </channel>
</rss>

