Command popup list?

Hello
How to get this popup list of autosuggest after typing a command?

image

image

Hi @seghierkhaled,

do you want to get the command names as list of strings or a popup (eg. in a dialog) ? Below is one way to get just the strings:

import Rhino
import scriptcontext
import rhinoscriptsyntax as rs

def DoSomething():
    
    # all command names
    n = Rhino.Commands.Command.GetCommandNames(True, True)
    
    # search string
    s = "Poi"
    
    set_a = set([c for c in n if c.startswith(s)])
    set_b = set([c for c in n if s in c and not c in set_a])
    
    print sorted(set_a)
    print sorted(set_b)
    
DoSomething()

_
c.

1 Like

Hi @clement
Thank you
I want something like search in Grasshopper but after run a command the popup list which already exist appears, this is possible in windows.form textbox with autocomplete option

image

Yes, this is what i would have suggested if you needed a dialog popup :slight_smile:

_
c.

Is this possible after run a command?

Hi @seghierkhaled, i’m not sure i understand. You would like to get such a popup after running a command ? Is this your own command or a specific Rhino command ?

Maybe like this example ?
_
c.

Like in Grasshopper
For example i run a command from my own plugin called: Tool
I type any letter and the suggestion appears based on an exist list.

Hi @seghierkhaled, i think the easiest would be if you prefix all your PlugIn command names with some special letters so you get the list with your other commands in the moment while you type, eg. “SK_Tool” will show all commands starting with “SK_” in the list.

Alternatively, to popup your own costomizable list after your “Tool” command finished, you can subscribe to the Command.EndCommand Event

_
c.

1 Like

Thank you
i will try that and figure out how to show the popup list