An AutoLISP file must be loaded into the AutoCAD program before it can be ran.
A message is displayed in the Console window if the program was loaded successfully.
If you switch back to Visual LISP before the command or function ends, the mouse pointer will appear as the Visual LISP icon. Switch back to AutoCAD and complete the command or function.
This example requires the installation of the Visual LISP Sample files.
Visual LISP responds by displaying a message in the Console window indicating it has loaded the program.
(drawline)
The drawline function will prompt you to specify two points, and will then draw a straight line between those points. When drawline prompts for user input, Visual LISP turns control over to AutoCAD to prompt for the points. What you see next depends on whether or not the AutoCAD windows are currently displayed on your desktop. If AutoCAD is already maximized, you will see the AutoCAD windows. But if AutoCAD is currently minimized, the windows will not automatically be restored and displayed. Instead, Visual LISP remains visible and your mouse pointer changes to a Visual LISP symbol.
This symbol indicates that the Visual LISP window is no longer active. If this is the case, you must manually switch to the AutoCAD window. Click the AutoCAD icon on the Windows task bar to activate AutoCAD.
After you respond to the prompts, control returns to Visual LISP and you will once again see the Visual LISP window.
When you enter commands in the Visual LISP Console window or run a program loaded from the text editor, you may be frequently switching back and forth between the Visual LISP and AutoCAD windows. Aside from using the standard Windows methods of switching between windows, you can activate the AutoCAD window by choosing Window Activate AutoCAD from the Visual LISP menu, or by clicking the Activate AutoCAD button on the Run toolbar. If you are in AutoCAD and want to return to the Visual LISP environment, you can click its icon on the Windows task bar, or enter vlisp at the Command prompt or click Manage tab Applications panel Visual LISP Editor.