# A Problem In My Custom Command's Mutiuse Flag

**URL:** https://forum.highend3d.com/t/a-problem-in-my-custom-commands-mutiuse-flag/48840
**Category:** Maya
**Tags:** python
**Created:** [May 26, 2008, 2:29am UTC](https://forum.highend3d.com/t/a-problem-in-my-custom-commands-mutiuse-flag/48840 "2008-05-26T02:29:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mjpark](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@mjpark](https://forum.highend3d.com/u/mjpark)
#### Post date: [May 26, 2008, 2:29am UTC](https://forum.highend3d.com/t/a-problem-in-my-custom-commands-mutiuse-flag/48840/1 "2008-05-26T02:29:47Z")

</div>

Hi.  
I’m a maya plugin developer in Korea.

I’'ve got some problem for creating a custom maya command.  
The problem is that multiuse flag does not work in Python.

(MEL) pwLocatorCmd -startMotion 0 -startMotion 1 → This works well  
(Python) pwLocatorCmd(startMotion=[0, 1]) → This does not work.

What’s wrong with this? Is a limitation of Maya’s current python support?  
Here is some portion of my c++ sources.

* * *

Syntax  
pwLocatorCmd::newSyntax()  
{  
MSyntax syntax;  
syntax.addFlag(pwLocatorStartMotionFlag, pwLocatorStartMotionFlagLong, MSyntax::kLong);  
syntax.makeFlagMultiUse(pwLocatorStartMotionFlag);  
return syntax;  
}

MStatus  
pwLocatorCmd::doIt(const MArgList& args)  
{  
MStatus status;  
if (agdb.isFlagSet(pwLocatorStartMotionFlag))  
{  
int nuses = agdb.numberOfFlagUses(pwLocatorStartMotionFlag);  
for (int i = 0; i \< nuses; i++)  
{  
MArgList aglst;  
status = agdb.getFlagArgumentList(pwLocatorStartMotionFlag, i, aglst);  
std::cout \<\< aglst.length() \<\< std::endl; ← always 0 !!!  
int s = 0;  
aglst.get(0, s);  
}  
return MS::kSuccess;  
}  
}
