Tuesday, April 17, 2007

Old-school Setup

If you followed the previous post, you now need to navigate Windows Explorer to your new custom directory. In this file, start a new empty text file and call it .lsp For this example, I'll use the name MyLisp.lsp. This is the file that will house your customisation.
Now to start altering your AutoCAD files. At this point I'd like to point out the necessity of backing up your original files. It's easy for the best programmer to make a silly mistake, so get into the habit of copying your working files.

Ok, point your file browser to your AutoCAD installation directory (usually C:\Program Files\AutoCAD 2008\ ). In the Support directory you will find a file called acad2008doc.lsp
Make a copy of this file in the same directory and rename it to acad2008doc.orig
Open the acad2008doc.lsp file and scroll riiiiiight down to the bottom.

At the bottom of this file you should find two lines that read:

;silent load

(princ)

Just above these lines we're going to tell AutoCAD to have a look for your customisation every time it loads a file, and to load your customisation automatically. You need to enter the following line:

(load "MyLisp.lsp")

I think it's also a good idea to make a comment in the file to remind yourself that this is where you edited the file. Any line of code in lisp that starts with a semi-colon ( ; ) is ignored by the program and treated as a programmers comment. This is the way to make notes for yourself inside your code. The end of my customised acad2008doc.lsp file looks like this:


acad2008doc.lsp


Make sure your file looks the same, and then save it. Now to start the fun stuff!

Labels: ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home