Hi, Can any one help me how to assign multiple command from commandMethod...
******************************************************************************
[CommandMethod("CA", "CT", "CD", "CB", CommandFlags.Modal)]
static public void CommonCommandOfC()
{
xxxxxx
}
**********************************************************
Thanks in advance
@kite15 wrote:
Hi, Can any one help me how to assign multiple command from commandMethod...
******************************************************************************
[CommandMethod("CA", "CT", "CD", "CB", CommandFlags.Modal)]
static public void CommonCommandOfC()
{
xxxxxx
}
**********************************************************
Thanks in advance
You cannot do that in the manner that you are showing.
If you need to define multiple commands to do something in code then you need to define each command individually and then have the code call a single method which performs the logic of the command.
[CommandMethod("CA", CommandFlags.Modal)] static public void CommandCa() { CommandCommon() } [CommandMethod("CT", CommandFlags.Modal)] static public void CommandCT() { CommandCommon() } [CommandMethod("CD", CommandFlags.Modal)] static public void CommandCD() { CommandCommon() } [CommandMethod("CB", CommandFlags.Modal)] static public void CommandCB() { CommandCommon() } static private void CommandCommon() { // Place command logic here. }
A more Autocad way of doing it would to be to create a single command and then define command aliases to call the command in a different manner without any coding at all.
You can read about command aliases here.