Select to view content in your preferred language

Python Toolbox: Tool without parameters throws error "'Tool' object has no attribute 'getParameterInfo'" - why?

632
1
Jump to solution
08-02-2023 10:22 AM
nadja
by
Frequent Contributor

We developer a python toolbox with one python script. The script doesnot need any parameters set, it just needs to run multiple times. 

Currently, we've managed that the script is executed once and it runs correctly.

However, as soon as we close the opened window, the tool cannot be started again by clicking on it. If we open the tool and click on the script, we get the error messagen "AttributeError: 'Tool' object has no attribute 'getParameterInfo'.

However, the tool can again be started by refreshing the tool - then it works again perfectly.  

Since the tool doesn't require any parameters, it doesn't make sense to set them. In order to get it to work, I tried it nonetheless, but with no success. Unfortunately, I cannot post the script, but I figure the question to be answered is: 

How to define properly the getParameterInfo for a script/tool which doesn't require any user-input, but just needs to run (multiple times)?

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
Luke_Pinner
MVP Regular Contributor

Do you have a getParameterInfo method defined?

    def getParameterInfo(self):
        """Define parameter definitions"""
        params = None
        return params

 

View solution in original post

0 Kudos
1 Reply
Luke_Pinner
MVP Regular Contributor

Do you have a getParameterInfo method defined?

    def getParameterInfo(self):
        """Define parameter definitions"""
        params = None
        return params

 

0 Kudos