active command

active command

Anonymous
Not applicable
531 Views
7 Replies
Message 1 of 8

active command

Anonymous
Not applicable
There is any way to know if there is any active command???
If so, there is any way to know if it is a command inside another command??

Thanks,
Aragao
0 Likes
532 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
Paulo,

Take a look at both CMDACTIVE and CMDNAMES system variables.

Regards,
Fernando.

"Paulo Aragao" wrote in message
news:D9C993180A9491EE39933F45E3D6F8DF@in.WebX.maYIadrTaRb...
> There is any way to know if there is any active command???
> If so, there is any way to know if it is a command inside another
command??
>
> Thanks,
> Aragao
>
>
0 Likes
Message 3 of 8

Anonymous
Not applicable
Hi,
Thanks for your suggestion!!

CHeers,
Aragao
"Fernando Poinho Malard" escreveu na mensagem
news:1076D02A03346F3239EB107DAEB86AE8@in.WebX.maYIadrTaRb...
> Paulo,
>
> Take a look at both CMDACTIVE and CMDNAMES system variables.
>
> Regards,
> Fernando.
>
> "Paulo Aragao" wrote in message
> news:D9C993180A9491EE39933F45E3D6F8DF@in.WebX.maYIadrTaRb...
> > There is any way to know if there is any active command???
> > If so, there is any way to know if it is a command inside another
> command??
> >
> > Thanks,
> > Aragao
> >
> >
>
>
0 Likes
Message 4 of 8

Anonymous
Not applicable
Good question and better answer. But next is howto cancel an active command?
Thanks.
Luis.
0 Likes
Message 5 of 8

Anonymous
Not applicable
Hi,

You can use AcEditorReactor::CommandWillStart(const char* strCmd)  and
acedPostCommand(const char*)

PS: acedPostCommand is an external function, so you have to declare
it:

 

extern
Adesk::Boolean acedPostCommand(const char* );

 

void

sgAcEditorReactor
size=2>::commandWillStart(const char* cmdStr

size=2>)

{

    // Cancel
line command.

   
acutPrintf
("\nEvent:
commandWillStart (%s)"
,
color=#808080>cmdStr

size=2>);

   
if
(strcmp
color=#000000>(
cmdStr,
"LINE"

face=Arial size=2>) == 0)

    {

   
    acutPrintf
(
color=#ff0000>"\nComando indisponível"

color=#000000>);
   
    acedPostCommand
(
color=#ff0000>"CANCELCMD"

face=Arial size=2>);

    }

color=#000000>
}

 

CHeers,

Aragao

 

 

>
Good question and better answer. But next is howto cancel an active
command?
> Thanks.
> Luis.
>
>
0 Likes
Message 6 of 8

Anonymous
Not applicable
I'll try it.

Thank you.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Hi,

You can use AcEditorReactor::CommandWillStart(const char* strCmd) 
and acedPostCommand(const char*)

PS: acedPostCommand is an external function, so you have to declare
it:

 

extern
Adesk::Boolean acedPostCommand(const char* );

 

void

sgAcEditorReactor
size=2>::commandWillStart(const char* cmdStr

size=2>)

{

    // Cancel
line command.


color=#880000>    acutPrintf

color=#000000>(
"\nEvent: commandWillStart
(%s)"
,
color=#808080>cmdStr

size=2>);


color=#0000ff>    if
(
color=#880000>strcmp
(
color=#808080>cmdStr
,
color=#ff0000>"LINE"

size=2>) == 0)

    {


color=#880000>        acutPrintf

color=#000000>(
"\nComando
indisponível"

size=2>);


color=#880000>       
acedPostCommand
(
color=#ff0000>"CANCELCMD"

face=Arial size=2>);

    }

color=#000000>
}

 

CHeers,

Aragao

 

 

>
Good question and better answer. But next is howto cancel an active
command?
> Thanks.
> Luis.
>
>
0 Likes
Message 7 of 8

Anonymous
Not applicable
Once a command is already in progress, you will be unable to use the
reactor technique.

If you have determined that a command is active you
can also use the following
call:

acDocManager->sendStringToExecute(curDocument, _T("\3\3"),
false, false, false);

regards

Mark


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

I'll try it.

Thank you.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Hi,

You can use AcEditorReactor::CommandWillStart(const char* strCmd) 
and acedPostCommand(const char*)

PS: acedPostCommand is an external function, so you have to declare
it:

 

extern
Adesk::Boolean acedPostCommand(const char* );

 

void

sgAcEditorReactor
size=2>::commandWillStart(const char* cmdStr

size=2>)

{

    //
Cancel line command.


color=#880000>    acutPrintf

color=#000000>(
"\nEvent: commandWillStart
(%s)"
,
color=#808080>cmdStr

face=Arial size=2>);


color=#0000ff>    if
(
color=#880000>strcmp
(
color=#808080>cmdStr
,
color=#ff0000>"LINE"

face=Arial size=2>) == 0)

    {


color=#880000>        acutPrintf

color=#000000>(
"\nComando
indisponível"

size=2>);


color=#880000>       
acedPostCommand
(
color=#ff0000>"CANCELCMD"

face=Arial size=2>);

    }

color=#000000>
}

 

CHeers,

Aragao

 

 

>
Good question and better answer. But next is howto cancel an active
command?
> Thanks.
> Luis.
>
>
0 Likes
Message 8 of 8

Anonymous
Not applicable
If you're trying to prevent one command from being
used transparently, there are ways to do that.

Can you describe in a bit more detail what your
objective is?

"Paulo Aragao" wrote in message news:D9C993180A9491EE39933F45E3D6F8DF@in.WebX.maYIadrTaRb...
> There is any way to know if there is any active command???
> If so, there is any way to know if it is a command inside another command??
>
> Thanks,
> Aragao
>
>
0 Likes