List all commands and aliases to text file?

i’d like to get a list of ALL the available commands. aliases, native, plugins…

i’ve got this snippet that lists plugin commands, easy to change?

import Rhino
plugins = Rhino.PlugIns.PlugIn.GetInstalledPlugIns()

for item in plugins:
   id = item.Key
   name = item.Value
   print name
   commands = Rhino.PlugIns.PlugIn.GetEnglishCommandNames(id)
   for command in commands:
       print "  - ", command

For aliases you could add

aliases=Rhino.ApplicationSettings.CommandAliasList.GetNames()

To get the macro associated with an alias you can use:

macro=Rhino.ApplicationSettings.CommandAliasList.GetMacro(alias_name)

Not sure you really want ‘native’ though, there are are over 1000…

damn my scripting sucks, i can’t even incorporate this simple change :expressionless:

what if i did want the whole shebang?

thanks mitch

import Rhino

aliases=Rhino.ApplicationSettings.CommandAliasList.GetNames()
for name in aliases:
    macro=Rhino.ApplicationSettings.CommandAliasList.GetMacro(name)
    print "Alias: {} | Macro: {}".format(name,macro)
all_rhino_commands=Rhino.Commands.Command.GetCommandNames(True,False)
for item in all_rhino_commands: print item
print "Total number of Rhino commands = {}".format(len(all_rhino_commands))

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Commands_Command_GetCommandNames.htm
(answer: 1230)

1 Like