call lisp / sendcommand in VBA

call lisp / sendcommand in VBA

Anonymous
Not applicable
545 Views
4 Replies
Message 1 of 5

call lisp / sendcommand in VBA

Anonymous
Not applicable
VBA won't pause till LISP / SendCommand ends, how to solve it? seems an old issue.

i have a VBA routine like this:
Sub test()
proc1
proc2
End Sub
proc1 may load & run LISP file
proc2 may use ThisDrawing.SendCommand
proc2 have to use the result of proc1 which requires the end of proc1 before proc2 can start run

the reason to do in this way is VBA object model doesn't support Topology so i have to use LISP to build it.
it's continuous processing, really don't want to manually seperate into pieces, any tricks to get around? thanks.

by the way, i use 2004.
0 Likes
546 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Public Sub wait()
Dim PauseTime, Start, Finish, TotalTime
PauseTime = 5 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop
Finish = Timer ' Set end time.
TotalTime = Finish - Start ' Calculate total time.
End Sub
i just modifed the timer example in the help file, this pauses the app for 5 secs. you could just set the timer for however long is the max time it usually takes for the lisp program to finish.
0 Likes
Message 3 of 5

Anonymous
Not applicable
proc1 calls lisp1
lisp1 calls proc2

Look into the "USER" variables.

--
gl - Paul
wrote in message news:5066689@discussion.autodesk.com...
VBA won't pause till LISP / SendCommand ends, how to solve it? seems an old
issue.

i have a VBA routine like this:
Sub test()
proc1
proc2
End Sub
proc1 may load & run LISP file
proc2 may use ThisDrawing.SendCommand
proc2 have to use the result of proc1 which requires the end of proc1 before
proc2 can start run

the reason to do in this way is VBA object model doesn't support Topology so
i have to use LISP to build it.
it's continuous processing, really don't want to manually seperate into
pieces, any tricks to get around? thanks.

by the way, i use 2004.
0 Likes
Message 4 of 5

Anonymous
Not applicable
thanks Squid.
1) it's hard to estimate the running time of lisp, besides, different machine & OS will also affect running time.
2) if i set pause time more than actual time needed for running lisp, no way to resume VBA running early? (immediately after finishing lisp running)
0 Likes
Message 5 of 5

Anonymous
Not applicable
thanks Paul, i'll try this method.
seems using "USERxx" variables is the way to get around, no other better way?
0 Likes