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. 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.
When drawline prompts for user input, Visual LISP turns control over to AutoCAD to prompt for the points. The drawline function will prompt you to specify two points, and will then draw a straight line between those points. Run the drawline function from the Console prompt by entering the function name in parentheses, then pressing Enter:.Visual LISP responds by displaying a message in the Console window indicating it has loaded the program. Click the Load Active Edit Window button from the Run toolbar, or click Tools Load Text in Editor.If you are not sure whether the window is active, click anywhere in the window to activate it. Make sure the text editor window containing the drawline.lsp program is active.In the Open File dialog box, browse to the SampleVisualLISP folder, which is located in your AutoCAD installation directory.This example requires the installation of the Visual LISP Sample files. Because the acad.lsp file is intended to be used for application-specific startup routines, all functions and variables defined in an acad.lsp file are. If an acad.lsp file is found, it is loaded into memory. When you start AutoCAD, it searches the support file search path for an acad.lsp file.
You can create an acad.lsp file if you regularly use specific AutoLISP routines. Respond to any prompts or dialog boxes that are displayed.Switch back to AutoCAD and complete the command or function. If you switch back to Visual LISP before the command or function ends, the mouse pointer will appear as the Visual LISP icon. At the AutoCAD Command prompt, enter the name of a command or function name in parentheses, and press Enter.At the Visual LISP Console window prompt, enter the name of a command or function name in parentheses, and press Enter.Start the AutoLISP function by doing one of the following:.From the Run toolbar, click Load Active Edit Window.Ī message is displayed in the Console window if the program was loaded successfully.In Visual LISP, do one of the following:.Open an AutoLISP (LSP) file and make sure the text editor is active.Note: The Visual LISP IDE is available on Windows only.