Select to view content in your preferred language

Python Toolbox Tool Display Order

988
5
Jump to solution
01-17-2013 10:50 AM
LorneDmitruk
Deactivated User
Hi,

I've been coding a python toolbox for use in a data conversion process. I would like the tools to be presented in the order in which they need to be run as opposed to alphabetical which seems to be default way the tool are listed. I have tried placing the tools in the order I want in the list for the tools for example:

class Toolbox(object):     def __init__(self):         """Define the toolbox (the name of the toolbox is the name of the         .pyt file)."""         self.label = "My Toolbox"         self.alias = ""         # List of tool classes associated with this toolbox         self.tools = [Importdata,Convertdata, CalculateMeasures, StationLine,         CreatePoints,ExtractPoint,CreateDataPackage] 


So other than naming the tools step 1, step 2 etc. is there a way to overide the default listing of the tools in a python toolbox?

Cheers!
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JimCousins
MVP Regular Contributor
Lorne,
Direct from the help:
Toolset and tool display order
Toolsets and tools are always displayed alphabetically. You cannot change this alphabetical ordering.
If there is some implied order to using tools within a toolbox or toolset, such as "use this tool first, then this tool," you should consider creating models, since models are the way you create and use a sequence of tools.

so, what about a tool that runs all of these in the appropriate order, in addition to the individual stand-alone tools?
Regards,
Jim

View solution in original post

0 Kudos
5 Replies
JimCousins
MVP Regular Contributor
Lorne,
Direct from the help:
Toolset and tool display order
Toolsets and tools are always displayed alphabetically. You cannot change this alphabetical ordering.
If there is some implied order to using tools within a toolbox or toolset, such as "use this tool first, then this tool," you should consider creating models, since models are the way you create and use a sequence of tools.

so, what about a tool that runs all of these in the appropriate order, in addition to the individual stand-alone tools?
Regards,
Jim
0 Kudos
LorneDmitruk
Deactivated User
Thanks Jim,

I knew I should have RTFM'd a little more deeply. I have thought about a tool that runs them all but I want the users to have a chance to inspect the results from each tool before they continue to the next. The other possibility would be to create a python add-in but I don't have time to figure that out right now.

Cheers!

Lorne,
Direct from the help:
Toolset and tool display order
Toolsets and tools are always displayed alphabetically. You cannot change this alphabetical ordering.
If there is some implied order to using tools within a toolbox or toolset, such as "use this tool first, then this tool," you should consider creating models, since models are the way you create and use a sequence of tools.

so, what about a tool that runs all of these in the appropriate order, in addition to the individual stand-alone tools?
Regards,
Jim
0 Kudos
ChrisSnyder
Honored Contributor
I don't think there's any shame in naming the tools "Step 1 - Do This", "Step2 - Do That", etc.

Another idea... What about having a single tool that pauses between sections and asks for a user response before continuing?
0 Kudos
Heidi_Kristenson
Regular Contributor

Any chance that this has changed in the intervening years? I would also like to set a specific display order for the tools in my python toolbox file. A user may not need or want to use every tool in my toolbox, so wrapping them into a model or a single tool doesn't really suit my purposes. I would like the users to see the tools available in the order that they might become useful. In the past I've gone with starting the label with a step number, but it would be tidier if I could just designate the order in the code for the toolbox.

0 Kudos
DanPatterson_Retired
MVP Emeritus

no change alphabetical still,

0 Kudos