4.7 Extra Steps


Perhaps the greatest selling point in AutoCAD's favor is its inclusion of AutoLISP as a customizing agent. Certainly, it's too early in our study of AutoCAD to be concerned with customizing it “ or at least too early to learn the AutoLISP programming language (although I highly recommend it later). But one thing not included in most textbooks is how to use AutoLISP.

You can use it to your advantage quite easily, and as there are zillions of lisp routines available in most CAD environments and the Internet (just ask the guy next to you), you should at least be comfortable with loading the programs.

The command sequence is very simple:

Command: (load "C:\Steps\lesson05/ views")

That's it! Note that the parentheses are required, as are the quotation marks around the path and file name . Note also that the slashes (normally backslashes) are front slashes. (AutoLISP reads backslashes as pauses in its routines.)

But in these days of dialog boxes, there's another way. Go to the Tools pull-down menu and select Load Application . (Alternately, you can enter Appload at the command prompt.) The Load/Unload Applications dialog box will appear (Figure 4.7a). Here is how to use it.

click to expand
Figure 4.7a:
  1. Use the upper half of the dialog box as you would a typical Windows Open File dialog box. Locate the file you wish to open . In Figure 4.7a, I've located the Views.lsp file in the C:\Steps\Lesson04 folder. The name of the selected file will appear in the File name: text box.

  2. Pick the Load button. The file appears in the Loaded Applications list box in the lower half of the dialog box.

  3. Pick the Close button to finish the procedure.

You must load each file into the drawing session every time you restart AutoCAD “ unless you use the Startup Suite to automatically load selected files when AutoCAD begins a new session.

Each file contains one or more programs or routines intended to shorten or ease your drawing time. Accessing a routine is as easy as typing a command (the command is identified “ or programmed “ into the routine). Thus, typing VS after loading the Views routine will enable you to store a view without the dialog box or the many prompts required as part of the normal View command. Typing VR will restore a view. Try it! You'll like it!

You might have noticed another Lisp routine in the C:\Steps\Lesson04 folder “ Text.lsp . Loading this one will provide two additional commands “ TH and CNT . TH enables you to change the height of existing text; CNT enables you to continue text below existing text as though you were in the Text command.

Note  

AutoCAD also provides access to another extremely valuable programming tool “ Visual Basic. But an understanding of AutoLISP is necessary to effectively use a VB program. Once you are comfortable with the use of AutoCAD, I highly recommend a study of AutoCAD Customization (including Lisp and VB).




AutoCAD 2004. One Step at a Time (Part 1)
AutoCAD 2004. One Step at a Time (Part 1)
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 162

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net