From Visual LISP, you can execute specific lines of AutoLISP code in a program.
Note: The Visual LISP IDE is available on Windows only.
- Open an AutoLISP (LSP) file and highlight the lines of code to run.
- Do one of the following:
- From the menu bar, click Tools Load Selection.
- On the Tools toolbar, click the Load Selection.
Visual LISP immediately executes the code and switches control to AutoCAD.
Example
This example requires the installation of the Visual LISP Sample files.
- In Visual LISP, click File Open File.
- In the Open File dialog box, browse to the Sample\VisualLISP folder, which is located in your AutoCAD installation directory.
- Double-click the drawline.lsp file.
- Highlight the following lines of code:
(setq pt1(getpoint "\nEnter the start point for the line: ")
pt2(getpoint pt1 "\nEnter the end point for the line: "))
- On the Tools toolbar, click Load Selection.
Visual LISP immediately runs the code and switches control to AutoCAD to prompt you for input.