AfraLisp Blog

The AutoLisp/Visual Lisp/VBA Resource Website

AfraLisp Blog

Home Newsletter Utter Rubbish Coding Tips AutoCAD Tips Contact Downloads WAUN

I stole this from the AutoCAD help 'cos I thought it was maybe worth looking into :

If you want to use a VBA macro to launch an AutoCAD interactive (built-in)
dialog box, AutoCAD does not open this dialog box until the VBA macro has
completed. (AutoCAD queues any AutoLISP commands that are executed using the ThisDrawing.SendCommand method until the VBA macro finishes.)

The result of this is that you cannot run code or make changes or verify

If you split the macro into two or more parts, and then use this queuing to
your advantage, you can force the macro to resume -- actually, the second
macro takes control when the dialog box is closed.

Here is a sample of a macro that calls a second 'part' after a dialog box is


Sub Test()

MsgBox "Please setup the layout the way you would like", vbOkOnly, "User Prompt"

' This command queues the launch of the 'Layout Wizard' dialog

ThisDrawing.SendCommand ("(command ""_layoutwizard"")" & vbCr)

' This command queues the second part of the macro

ThisDrawing.SendCommand ("(command ""_-vbarun"" ""Test_Part_2"")" & vbCr)

End Sub

Sub Test_Part_2()

MsgBox "Part 2"

End Sub


The AutoLisp/Visual Lisp/VBA Resource Website

Copyright 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website