0

I have written my codes as seperate python toolboxes. Then i decided to merge them into one. anyway I can't figure out how. I wrote like this:

class MuglaToolbox(object):
def __init__(self):
    """Define the toolbox (the name of the toolbox is the name of the
    .pyt file)."""
    self.label = "Mugla Toolboxes"
    self.alias = "Mugla Raster Plan Toolbox / yazar: Umut Ucok"

    # List of tool classes associated with this toolbox
    self.tools = [ReverseNaming,WarpProjectTool,ProjectRasterTool, RenamingTool, ClipTool]

after self.tools sentence, i write my whole code as class. For instance: class ReverseNaming(object): etc. etc. class WarpProjectTool: etc etc.

but i can't see them in one. how can i do this?

1

1 Answer 1

2

From the ArcGIS help:

Tip:

To ensure the Python toolbox is recognized correctly by ArcGIS, the toolbox class must remain named "Toolbox".

So use the following instead:

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

        self.label = "Mugla Toolboxes" 
        self.alias = "Mugla Raster Plan Toolbox / yazar: Umut Ucok" 
        # List of tool classes associated with this toolbox 
        self.tools = [ReverseNaming,WarpProjectTool,ProjectRasterTool, RenamingTool, ClipTool]


class ReverseNaming(object) :
    def __init__(self): 
        etc...


class WarpProjectTool(object) :
    def __init__(self): 
        etc...


class ProjectRasterTool(object) :
    def __init__(self): 
        etc...
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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