User interaction withou acedCommand() or acedCmd()

User interaction withou acedCommand() or acedCmd()

Anonymous
Not applicable
599 Views
5 Replies
Message 1 of 6

User interaction withou acedCommand() or acedCmd()

Anonymous
Not applicable
Hello,

I need to call AutoCAD native commands from a Modeless dialog. I know that I
can't use acedCommand() or acedCmd().

Further the desired commands will also need user interaction like, for
instance, INSERT command where I will need to PAUSE for user to select
insertion point.

The dialog must be Modeless because it has a huge tree control and I can't
build it on every user command call.

I have tried several options but the problem seems to be related with the
PAUSE for user input (user interaction)...

Regards,
Fernando
0 Likes
600 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
I don't understand - what isn't working? You say that the problem is
related to the PAUSE - what problem is it?

If you want to mimic the INSERT functionality, you should look into AcEdJig.
The example that comes with the SDK should probably be enough to teach you
how to use it...


-Rich



"Fernando Poinho Malard" wrote in message
news:6B9AD4B620D7C047BBE3CA9C5AEA322F@in.WebX.maYIadrTaRb...
> Hello,
>
> I need to call AutoCAD native commands from a Modeless dialog. I know that
I
> can't use acedCommand() or acedCmd().
>
> Further the desired commands will also need user interaction like, for
> instance, INSERT command where I will need to PAUSE for user to select
> insertion point.
>
> The dialog must be Modeless because it has a huge tree control and I can't
> build it on every user command call.
>
> I have tried several options but the problem seems to be related with the
> PAUSE for user input (user interaction)...
>
> Regards,
> Fernando
>
>
0 Likes
Message 3 of 6

Anonymous
Not applicable
Justavian,

The problem is not related only to INSERT command.
The problem seems to be related to PAUSE because it requires user to be
focused on AutoCAD drawing screen and consequently with every command that
requires user interaction.

Once acedCommand() and acedCmd() both does not work in this context I have
to find another way to do that.

One solution I have found shows a trick using ADS registered functions to
interact with AutoCAD and when finished send a message to the modeless
dialog but I don't like this trick once it will cause a lot of problems
because my procedures are using a lot of information stored inside the
dialog. So I can imagine a hell to pass and get information around.

If I can manage this by a clean method from the dialog it would be nice...

Any crazy tip would be nice...

Thanks,
Fernando.

"Justavian" wrote in message
news:993D031708B884323A452BE7100FB239@in.WebX.maYIadrTaRb...
> I don't understand - what isn't working? You say that the problem is
> related to the PAUSE - what problem is it?
>
> If you want to mimic the INSERT functionality, you should look into
AcEdJig.
> The example that comes with the SDK should probably be enough to teach you
> how to use it...
>
>
> -Rich
>
>
>
> "Fernando Poinho Malard" wrote in message
> news:6B9AD4B620D7C047BBE3CA9C5AEA322F@in.WebX.maYIadrTaRb...
> > Hello,
> >
> > I need to call AutoCAD native commands from a Modeless dialog. I know
that
> I
> > can't use acedCommand() or acedCmd().
> >
> > Further the desired commands will also need user interaction like, for
> > instance, INSERT command where I will need to PAUSE for user to select
> > insertion point.
> >
> > The dialog must be Modeless because it has a huge tree control and I
can't
> > build it on every user command call.
> >
> > I have tried several options but the problem seems to be related with
the
> > PAUSE for user input (user interaction)...
> >
> > Regards,
> > Fernando
> >
> >
>
>
0 Likes
Message 4 of 6

Anonymous
Not applicable
Hi,
As I understand, you need a general method for invoking each and every acad
command, so the need for acedCommand() or acedCmd() and the /PAUSE problem?
If so, can't help, sorry.
Else, for each command you want to implement, you can interactively acquire
the data using
acedGetxx() funcs (e.g. acedGetPoint()), acedGetReal() twice and
acedGetAngle() for INSERT),
thus dispensing with acedCommand() or acedCmd().

Hope it helps,

alex
0 Likes
Message 5 of 6

Anonymous
Not applicable
alex,

The problem is related to Modeless dialogs and AutoCAD drawing screen.
My dialog is huge and I need to hide it before go to the drawing screen.
If I send a command through a sendStringToExecute() function, that is the
recommended method for modeless dialog calls, AutoCAD process the command
but the dialog does not wait the end of process to get back.
This way the dialog appear in front of AutoCAD screen even the command is
not finished yet.

Hope you understand now my situation...
Regards,
Fernando.

"alex" wrote in message
news:CF98946EE24E760EBACB014F7DE101A3@in.WebX.maYIadrTaRb...
> Hi,
> As I understand, you need a general method for invoking each and every
acad
> command, so the need for acedCommand() or acedCmd() and the /PAUSE
problem?
> If so, can't help, sorry.
> Else, for each command you want to implement, you can interactively
acquire
> the data using
> acedGetxx() funcs (e.g. acedGetPoint()), acedGetReal() twice and
> acedGetAngle() for INSERT),
> thus dispensing with acedCommand() or acedCmd().
>
> Hope it helps,
>
> alex
>
>
>
0 Likes
Message 6 of 6

Anonymous
Not applicable
Fernando,
If the problem is hiding the dialog, you can do it like so:
...
...
myclass_dlg *dlg;//ptr to dialog
...
...
dlg->EnableWindow(FALSE);
dlg->ShowWindow(SW_HIDE);
...
...
//user does what users do...
...
...
dlg->ShowWindow(SW_SHOW);
dlg->EnableWindow(TRUE);
dlg->SetFocus();

About the sendStringToExecute() method, I tried it long ago and decided
against it as clumsy
and unreliable. To me it looks like LISP inside ARX.
I prefer the 'pure' ARX methods - see my former post - which, although
harder to code give you much more control and are safer, to say nothing
about all those
variables which the user feeds to YOUR program - not to acad - and which you
can subsequently
use.

hope it helps.

alex
0 Likes