Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Stop VB code until AutoCAD command is executed.

731 views
Skip to first unread message

mgrigoriev

unread,
May 12, 2004, 12:04:47 PM5/12/04
to
Hi,
I send a command to AutoCAD:
ThisDrawing.SendCommand "_-boundary" & vbCr
and expect a user to pick the boundary point.
I want my VB code to wait until the command is finished and proceed when a user picks point(s). The code never stops, and AutoCAD is disabled until the code is fully executed. I tried implementing the EndCommand event, but it didn't work for me. I guess I never learned how to use it.
Thanks,
Mike

Jorge Jimenez

unread,
May 12, 2004, 12:28:35 PM5/12/04
to
Try using a loop checking

ThisDrawing.Application.GetAcadState.IsQuiescent

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica
(sorry, phony e-mail, SPAM made me do it)

"mgrigoriev" <nos...@address.withheld> wrote in message
news:33452397.1084377918737.JavaMail.javamailuser@localhost...

Tony Tanzillo

unread,
May 12, 2004, 1:24:13 PM5/12/04
to
If you are not executing your command from a hidden VB form, you
can try starting your MACRO using this, instead of VBARUN:

(defun C:VBARUNX ()
(vl-load-com)
(vla-runmacro
(vlax-get-acad-object)
(getstring "\nMacro name: ")
)
(princ)
)

I can't say for sure if it will work, but its worth a try. If that does
not work, there is an alternative (AcadX, available at the website
below).

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005
http://www.acadxtabs.com


"mgrigoriev" <nos...@address.withheld> wrote in message news:33452397.1084377918737.JavaMail.javamailuser@localhost...

Ed Jobe

unread,
May 12, 2004, 1:53:12 PM5/12/04
to
Download adcgSendCmdSync from here: http://www.activedwg.com/html/Download_Links.htm
 
Load the arx, it registers a new command, VBARUNEX. Use this command to run your macro.

--
----
Ed
----
Jorge, the loop just hangs the computer. Do you have any ideas how to avoid that?

Jorge Jimenez

unread,
May 12, 2004, 1:52:50 PM5/12/04
to
That's because ACAD is still waiting for some user interaction.

Maybe trying another approach is the answer.

Why not pick the points before using the sendcommand ??

--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica
(sorry, phony e-mail, SPAM made me do it)
"mgrigoriev" <nos...@address.withheld> wrote in message

Jeff Mishler

unread,
May 12, 2004, 4:45:54 PM5/12/04
to
Done!


"Matt W" <ma...@bvhis.com> wrote in message news:40a28703$1_2@newsprd01...
> Can someone please post that file (adcgSendCmdSync) to the CF NG??
> Due to network restrictions, the Autodesk sites are the only place "I'm
allowed" to download files from.
>
> Thanks!
>
> --
> Matt W


Matt W

unread,
May 12, 2004, 5:15:18 PM5/12/04
to
Soooo... I take it this is not a viable solution for 2004 or higher, huh????

--
Matt W
 
There are 3 kinds of people:
  Those who can count, and those who can't.
 
 

"Jeff Mishler" <mi...@USESsonic.net> wrote in message news:40a28cfe_3@newsprd01...

Jeff Mishler

unread,
May 12, 2004, 5:41:24 PM5/12/04
to
Heh, that I do not know. I just posted it from the website. But seeing how
most arx routines need to be recompiled from version to version, it doesn't
surprise me.

Jeff

"Matt W" <ma...@bvhis.com> wrote in message news:40a293ae$1_3@newsprd01...

Ed Jobe

unread,
May 12, 2004, 5:43:13 PM5/12/04
to
Why do you say that?

--
----
Ed
----
"Matt W" <ma...@bvhis.com> wrote in message news:40a293ae$1_3@newsprd01...

Tony Tanzillo

unread,
May 12, 2004, 7:43:56 PM5/12/04
to
Did you try the simple LISP code I posted?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005
http://www.acadxtabs.com


"Matt W" <ma...@bvhis.com> wrote in message news:40a293ae$1_3@newsprd01...

mgrigoriev

unread,
May 13, 2004, 4:58:20 PM5/13/04
to
Ok, I figured out this one. I put the EndCommand event into ThisDrawing. In the EndCommand event I called another procedure. This way my code will not continue until the EndCommand triggers. Of course, I had to figure out how to send text into the ThisDrawing code.
Thanks everyone!
Mike

André Dantas Rocha

unread,
Oct 29, 2004, 9:13:10 AM10/29/04
to
I'm execution the command from a hidden form and the problem persists. Is
there a solution like AdcgSendCmdSync?

Thanks


"Tony Tanzillo" <tony.t...@bogus.com> escreveu na mensagem
news:40a263ea_1@newsprd01...

0 new messages