Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asynchronous processing when using sendcommand in vba

Status
Not open for further replies.

KrisV

Technical User
Nov 19, 2002
3
BE
I'm writing a vba-program in acad2000.
because the divide command is not supported in vba its possibble to use the sendcommand method.
however this leads to the following problem. Autocad does not process these commands until it has finished the vba program, leading to unwanted results.
(it does work when the program is run from the vba editor, but not when i run it with tools-macros-macro ...run)
i've tried the acadstate property but acad is busy until the program is done. no-luck here
iv'e also tried to wait for the endcommand event but running the macro is actually the command "vbarun" so there was no event until the program stopped.
What i'm going to try now is to cut my program in several parts and run them from a program that controls a timer and checks if acadstate is quiescent before running the next part. I feel this not to be a proper way. If anyone has a better idee to deal with this please let me know

regards Kris
 
I am not sure this works in all cases, but can you place the send command into its own sub routine that gets called from the main program. After it completes, it will return to the main. I have used this to mimic some user interaction pauses.

BU
 
Hey Borgunit
Thanks for your suggestion, sorry it did not work.
If i find a solution i'll let you know.
Regards Kris
 
Just a thought. I am not sure how your program works but could a VisualLisp app get you what you want. It give you a lot of the advantages of LISP and VBA in a new "language".

BU
 
I don't know, I never looked at LISP.
i've got myself started in vba because I did some programming in VB. I'm still learning the language.
(I do have a background in assembly for microcontrollers, and in the old days there once was a ZX81...)

If you want I can send you my program by e-mail.

Greetz Kris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top