Validate name of command

Hello everyone,

does anybody know if there is any command list available in API? With their EnglishNames or just derived from Command instance objects? I’m playing with a command which takes as input a name of another command to listen to. I wanted to notify the user if a certain command he typed in is valid or not - for eg. the user made a typo.

In case the answer isn’t that simple, @dale if you don’t mind to drop few lines here, where to start, or if I should just let it go.

Unless you want to use _CommandList, I did something similar for Peacock commands by getting all assemblies in AppDomain, take those that reference Peacock.dll (in your case RhinoCommon.dll and maybe Rhinocommon_c.dll as well, IDK), from this assemblies, take its classes that derive from Command, create an instance, and access its properties. Of course just do this once, when the plugin loads or the first time calling that feature.

Hi @D-W,

RhinoCommon doesn’t have a method that will return the names of all Rhino commands. But you can always see if a command name exists by using Command.IsCommand.

– Dale

1 Like

Thanks a lot this one is perfect! Seems I was totally blind while digging in API :joy: