See also the prettier version of this lesson.
File it
The way to save your AutoLISP work is to keep it in an AutoLISP Application Source (lsp) or sometimes an AutoLISP Menu Source (mnl) file.If you are a programmer or an experienced computer user, you already have your own system (I recommend Notepad++) for text file editing and management. If not, this is a great time to learn. We will file the AutoLISP program on your Windows Desktop.
-
Type this at the AutoCAD command line:
notepad
- Press [Enter] again instead of supplying a file name.
- The Windows Notepad file editor will open.
- Select the File, Save As... menu
- The Save As form will open:
- Browse to the Windows Desktop:
- Type l0.lsp in the "File name:" area:
(defun c:l0 () (command "._layer" "_thaw" "0" "_set" "0" "_unlock" "0" "_on" "0" ""))
- Click the Save button.
- Type the (c:l0) function into the Notepad window:
- Save and Exit Notepad.
Load it
To use your AutoLISP program, you have to load it into AutoCAD. Show the Desktop or browse to the Desktop in Windows Explorer. Then drag l0.lsp to the AutoCAD drawing area. If the AutoCAD drawing area isn't visible, drag l0.lsp onto the AutoCAD program on the Windows Taskbar, hold a second or two, then drag it into the AutoCAD drawing area when AutoCAD appears.Now let's learn how to make it a part of your system permanently.
Previous lessons
No comments:
Post a Comment