Named parameters on a long command

2013-07-03 Thread Mihail Djurev
Hello, I have a custom command with 10+ parameters and each of these parameters has a name and a default value. Right now I'm forced to use something like MyCommand(cube, 1, 20, , , , , , , true); This approach, however is very cumbersome and error-prone. I was wondering if there is a way to

Re: Named parameters on a long command

2013-07-03 Thread Alok Gandhi
You can set default values in command definition(plugin registration). But you cannot specify argument name and value when you are calling the command. On Wed, Jul 3, 2013 at 7:43 AM, Mihail Djurev mihail.dju...@chaosgroup.comwrote: Hello, I have a custom command with 10+ parameters and

Re: Named parameters on a long command

2013-07-03 Thread Eric Thivierge
Could you wrap the command in a python function? def myFunction(arg1=Default, arg2=1, arg3=True, arg4=String): xsi.myCommand(arg1,arg2,arg3,arg4) myFunction(arg2=3, arg4=String2) Eric Thivierge === Character TD / RnD Hybride Technologies On 03/07/2013 7:43 AM, Mihail

Re: Named parameters on a long command

2013-07-03 Thread Mihail Djurev
Thanks Eric, that will do. Mihail

Re: Named parameters on a long command

2013-07-03 Thread Cesar Saez
A handy python wrapper I have around on my library, perhaps it's usefull for you too :-) def pywrap(cmd_name, **kwds): cmd = Application.Commands(cmd_name) if not cmd: Application.LogMessage(cmd_name + doesnt found., 4) return for arg in cmd.Arguments: value