Skip to main content
Tweeted twitter.com/StackGIS/status/1404363002283970563
Became Hot Network Question
naming; English usage
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

Getting new parameter after python toolbox gotPython Toolbox gets executed

iI am trying to build a toolbox which would first take some inputs and execute some code and return me results. After the results iI would like toolbox to ask me for new parameters so iI can use these results.

Getting new parameter after python toolbox got executed

i am trying to build a toolbox which would first take some inputs and execute some code and return me results. After the results i would like toolbox to ask me for new parameters so i can use these results.

Getting new parameter after Python Toolbox gets executed

I am trying to build a toolbox which would first take some inputs and execute some code and return me results. After the results I would like toolbox to ask me for new parameters so I can use these results.

edited tags
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
Source Link

Getting new parameter after python toolbox got executed

i am trying to build a toolbox which would first take some inputs and execute some code and return me results. After the results i would like toolbox to ask me for new parameters so i can use these results.

Here is my idea with the code

# -*- coding: utf-8 -*-

import arcpy


class Toolbox(object):
    def __init__(self):
        """Define the toolbox (the name of the toolbox is the name of the
        .pyt file)."""
        self.label = "Toolbox"
        self.alias = "toolbox"

        # List of tool classes associated with this toolbox
        self.tools = [Tool]


class Tool(object):
    def __init__(self):
        """Define the tool (tool name is the name of the class)."""
        self.label = "Tool"
        self.description = ""
        self.canRunInBackground = False

    def getParameterInfo(self):
        """Define parameter definitions"""

        input_folder = arcpy.Parameter(
            name='input_folder',
            displayName='Input Folder',
            datatype='DEWorkspace',
            direction='Input',
            parameterType='Required')

        params = [input_folder]
        
        return params

    def isLicensed(self):
        """Set whether tool is licensed to execute."""
        return True

    def updateParameters(self, parameters):
        """Modify the values and properties of parameters before internal
        validation is performed.  This method is called whenever a parameter
        has been changed."""
        return

    def updateMessages(self, parameters):
        """Modify the messages created by internal validation for each tool
        parameter.  This method is called after internal validation."""
        return

    def execute(self, parameters, messages):
        """The source code of the tool."""

        #show me some results which i will make use.

        #execute something to get new parameter from user input and make operation.
        
        #and make the operation.
        return