BeginLISP Event (ActiveX)

Triggered immediately after AutoCAD receives a request to evaluate an AutoLISP expression.

Supported platforms: Windows only

Signature

VBA:

object.BeginLISP(FirstLine)
object

Type: Application, Document

An object expression that evaluates to a valid container object. In this case, the only valid containers are the application and the document.

FirstLine

Type: String; input-only

The name of the AutoLISP expression about to be executed by the AutoLISP interpreter. FirstLine will not have any case conversion of the alpha characters.

If the AutoLISP function being executed is defined (with defun) as a C:xxx function and is being executed as an AutoCAD command (such as just using the xxx part of the function name and no parentheses), then FirstLine will be the complete function name including the C: prefix and will be enclosed inside a pair of parentheses—just the way it would appear when executed as a true AutoLISP function call. Otherwise, FirstLine will be the actual AutoLISP expression that has been typed in at the AutoCAD command line or is part of a menu macro.

For example:

  • If there is a user-defined AutoLISP function loaded called C:TEST, and it is executed by typing "TEST" at the command line, then FirstLine will be (C:TEST).
  • If there is a user defined AutoLISP function loaded called calc and it is executed as (cAlc), then FirstLine will be (cAlc).
  • If a menu macro contains (getvar "cmdecho"), then FirstLine will be (getvar "cmdecho").

Remarks

No events will be fired while a modal dialog is being displayed.

Examples

VBA:

Private Sub AcadDocument_BeginLisp(ByVal FirstLine As String)
    ' This example intercepts a drawing BeginLisp event.
    '
    ' This event is triggered when a drawing receives
    ' a request to evaluate a LISP expression.
    '
    ' To trigger this example event: Start the evaluation of a LISP expression

    ' Use the "FirstLine" variable to help the user determine which LISP expression is running
    MsgBox "A LISP expression has just started to be evaluated.  The first line of the expression is: " & FirstLine

End Sub

Visual LISP:

Not available