"Pause" VBA until LISP finishes

"Pause" VBA until LISP finishes

Anonymous
Not applicable
1,088 Views
7 Replies
Message 1 of 8

"Pause" VBA until LISP finishes

Anonymous
Not applicable
I use VBA to display a form, and want to include a couple of command buttons to call LISP routines that require several inputs from the user. When the user clicks a command button, I want to hide the form, run the command, and make the form reappear after the lisp command is finished. VBA takes over control of AutoCAD if the user presses Enter when responding to any of the prompts from AutoCAD.

After using SendCommand to call a lisp routine, is there a way to make VBA wait until the lisp routine is finished?
0 Likes
1,089 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
Hi,

In version of AutoCAD up to 2004 - No

I have not tried in later versions, but have heard rumours that it may have
been fixed.

--


Laurie Comerford
CADApps
www.cadapps.com.au

wrote in message news:4849204@discussion.autodesk.com...
I use VBA to display a form, and want to include a couple of command buttons
to call LISP routines that require several inputs from the user. When the
user clicks a command button, I want to hide the form, run the command, and
make the form reappear after the lisp command is finished. VBA takes over
control of AutoCAD if the user presses Enter when responding to any of the
prompts from AutoCAD.

After using SendCommand to call a lisp routine, is there a way to make VBA
wait until the lisp routine is finished?
0 Likes
Message 3 of 8

Anonymous
Not applicable
You might be able to throw this in a loop.
ThisDrawing.Application.GetAcadState.IsQuiescent

Regards - Nathan
0 Likes
Message 4 of 8

Anonymous
Not applicable
You could try trapping the EndLisp event. Problem is you have no way of
knowing the name of the function that just terminated. Lisp has .dcl dialog
boxes. Why not use those?
Ken Hutson
San Antonio, TX

wrote in message news:4849204@discussion.autodesk.com...
I use VBA to display a form, and want to include a couple of command buttons
to call LISP routines that require several inputs from the user. When the
user clicks a command button, I want to hide the form, run the command, and
make the form reappear after the lisp command is finished. VBA takes over
control of AutoCAD if the user presses Enter when responding to any of the
prompts from AutoCAD.

After using SendCommand to call a lisp routine, is there a way to make VBA
wait until the lisp routine is finished?
0 Likes
Message 5 of 8

Anonymous
Not applicable
Hi Kenneth,

For the same reason he doesn't use EDLIN.

--

Regards,


Laurie Comerford
www.cadapps.com.au

"Kenneth Hutson" wrote in message
news:4849897@discussion.autodesk.com...
You could try trapping the EndLisp event. Problem is you have no way of
knowing the name of the function that just terminated. Lisp has .dcl dialog
boxes. Why not use those?
Ken Hutson
San Antonio, TX

wrote in message news:4849204@discussion.autodesk.com...
I use VBA to display a form, and want to include a couple of command buttons
to call LISP routines that require several inputs from the user. When the
user clicks a command button, I want to hide the form, run the command, and
make the form reappear after the lisp command is finished. VBA takes over
control of AutoCAD if the user presses Enter when responding to any of the
prompts from AutoCAD.

After using SendCommand to call a lisp routine, is there a way to make VBA
wait until the lisp routine is finished?
0 Likes
Message 6 of 8

Anonymous
Not applicable
Hi Laurie,

I wouldn't suggest anyone start using DCL either but EDLIN is something I've never heard of. Can you satisfy my curiosity and tell me what it is.

Regards - Nathan
0 Likes
Message 7 of 8

Anonymous
Not applicable
Hi Nathan,

The original command line "line editor" supplied with DOS.

Your lucky you've never used it.

--

Regards,


Laurie Comerford
www.cadapps.com.au


wrote in message news:4849930@discussion.autodesk.com...
Hi Laurie,

I wouldn't suggest anyone start using DCL either but EDLIN is something I've
never heard of. Can you satisfy my curiosity and tell me what it is.

Regards - Nathan
0 Likes
Message 8 of 8

Anonymous
Not applicable
How about setting ShowModal to False and the
use something like this. Work around but functional.

Private Sub cmdRestore_Click()
Me.Height = 400
Me.Width = 400
Me.top = 50
Me.Left = 100
cmdRestore.Visible = False
End Sub

Private Sub cmdLisp_Click()
Me.Height = 92.5
Me.Width = 92.5
Me.top = 0
Me.Left = 0
cmdRestore.Visible = True
ThisDrawing.SendCommand "TestLISP "
End Sub

gl
wrote in message news:4849204@discussion.autodesk.com...
I use VBA to display a form, and want to include a couple of command buttons
to call LISP routines that require several inputs from the user. When the
user clicks a command button, I want to hide the form, run the command, and
make the form reappear after the lisp command is finished. VBA takes over
control of AutoCAD if the user presses Enter when responding to any of the
prompts from AutoCAD.

After using SendCommand to call a lisp routine, is there a way to make VBA
wait until the lisp routine is finished?
0 Likes