The Visual LISP Console window allows you to enter AutoLISP code and immediately see the results of executing that code.
NoteThe Visual LISP IDE is available on Windows only.
This is similar to what you can do at the AutoCAD Command prompt, but there are a few differences—some subtle—in how you accomplish
the same task in these two windows.
For example, to display the current value of an AutoLISP variable in Visual LISP, you simply type the variable name in the
Console window and press Enter. To view the value of a variable at the AutoCAD Command prompt, you must precede the variable
name with an exclamation point (!).
The appearance of the two prompts is also different, AutoCAD Command prompt displays the initial prompt Command: while the
Console window prompt looks like the following:
As you use the Console window, it saves the text you enter and any output from executing the text. You can then scroll through
the Console window and see what transpired, or press Tab and Shift+Tab to retrieve previously entered text. The Console window
is also where Visual LISP displays AutoLISP diagnostic messages and the results of many AutoLISP functions. For example, output
from the print and princ functions is displayed in the Console window.
NoteUnlike the AutoCAD Command window, the Visual LISP Console window is not document sensitive. There is only one Console window
available and all entered text is accessible regardless of the file open in the active text editor window.
The following is a brief summary of the features that the Visual LISP Console window offers:
- AutoLISP expressions can be evaluated and the return value displayed. Pressing Enter evaluates the entered AutoLISP expression.
- AutoLISP expressions can be entered on multiple lines by pressing Ctrl+Enter to continue on the next line. Pressing Enter
evaluates the entered AutoLISP expressions. Unlike the AutoCAD Command window, pressing Spacebar does not cause an expression
to be evaluated.
- Multiple expressions can be evaluated at one time.
- Text can be copied and transferred between the Console and text editor windows.
- Previous entered functions can be retrieved in the Console by pressing Tab. Pressing Shift+Tab reverses the direction of function
- Selecting previous results or entered text in the Console window, and pressing Enter copies the text to the Console prompt.
- Associative searches can be performed through the input history by pressing Tab. For example, if you begin an expression
with (+ and then press Tab, Visual LISP retrieves the last function you entered that begins with (+. Pressing Shift+Tab reverses
the direction of the search.
- Expressions entered after the Console window prompt can be cleared by pressing Esc. Pressing Shift+Esc interrupts and leaves
the expression entered at the Console window prompt without evaluating the expression, and displays a new Console window prompt.
For example, if you enter an invalid function call like the following:
((setq origin-x (car origin)
Pressing Shift+Esc interrupts the code and the message “input discarded” is displayed:
- Activities performed in the Console window can be recorded and saved to a log file. Create a log file by clicking File Toggle Console Log from the Visual LISP menu.
NoteExpressions entered at the Console window prompt are removed if Enter is not pressed before switching to the AutoCAD drawing