Jump to content

how do i install and use a lisp routine?


ironman

Recommended Posts

Let me educate you with how I would do it (there's more than one way to skin a lisp file).

 

Quick overview:

-Create a folder outside of AutoCAD's install to keep all your autolisp files (and any other custom files)

-Add that folder to your File Search Path in AutoCAD

-Load the Lisp file in AutoCAD

-Execute the Lisp file in AutoCAD

 

Setup:

 

1. Create a folder to house your custom files. I use C:\autocad_custom\

2. Create a sub-folder for your lisp files. I use C:\autocad_custom\autolisp\

3. Put your custom (downloaded) lisp file in the autolisp folder.

4. Start AutoCAD.

5. Go to Tools->Options and select the FILES tab.

6. Expand the Support File Search Path then click ADD on the right side.

7. Click BROWSE and find the autolisp folder you created earlier and click OK and OK to make the changes.

 

Loading the Lisp file:

 

8. Type APPLOAD (AP for short) at the command prompt and hit enter.

9. Browse to your autolisp folder and click on the lisp file you want, then click LOAD and then CLOSE.

 

Using the Lisp file:

 

10. Usually you type the name of the lisp file (once loaded) to use it. Sometimes, once loaded, the author displays what you need to type in ordered to use that lisp file. If the name (minus the .lsp extension) doesn't work, and the author didn't inform you what to type, then you'll need to open the lisp file (either in VLIDE or NOTEPAD) and look at the (defun c: ) part. What comes after the c: is what you need to type to run the file (once loaded). Example:

 

C:SteelBeam ~ type steelbeam

C:RodShelf ~ type rodshelf

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

 

Using the Lisp file:

 

10. Usually you type the name of the lisp file (once loaded) to use it. Sometimes, once loaded, the author displays what you need to type in ordered to use that lisp file. If the name (minus the .lsp extension) doesn't work, and the author didn't inform you what to type, then you'll need to open the lisp file (either in VLIDE or NOTEPAD) and look at the (defun c: ) part. What comes after the c: is what you need to type to run the file (once loaded). Example:

 

C:SteelBeam ~ type steelbeam

C:RodShelf ~ type rodshelf

 

An addition to #10.

 

If there is code outside of a (defun), that code will execute as soon as the file is loaded.

 

The C: prefix allows that defun to be executed at the command line. This is how it's done for user function most of the time. If the defun does not include the C:, then you have to type in the entire function name including the parens.

(defun G:foobar ()
(code...)
)

In this case, you would have to type in (G:foobar) to execute this function.

Link to comment
Share on other sites

  • 12 years later...

Thanks Dommy2Hotty!

 

Awesome, concise, and complete instructions.

It worked exactly as you stated. Great 12-year old post!

 

gtehan

 

Let me educate you with how I would do it (there's more than one way to skin a lisp file).

 

Quick overview:

-Create a folder outside of AutoCAD's install to keep all your autolisp files (and any other custom files)

-Add that folder to your File Search Path in AutoCAD

-Load the Lisp file in AutoCAD

-Execute the Lisp file in AutoCAD

 

Setup:

 

1. Create a folder to house your custom files. I use C:\autocad_custom\

2. Create a sub-folder for your lisp files. I use C:\autocad_custom\autolisp\

3. Put your custom (downloaded) lisp file in the autolisp folder.

4. Start AutoCAD.

5. Go to Tools->Options and select the FILES tab.

6. Expand the Support File Search Path then click ADD on the right side.

7. Click BROWSE and find the autolisp folder you created earlier and click OK and OK to make the changes.

 

Loading the Lisp file:

 

8. Type APPLOAD (AP for short) at the command prompt and hit enter.

9. Browse to your autolisp folder and click on the lisp file you want, then click LOAD and then CLOSE.

 

Using the Lisp file:

 

10. Usually you type the name of the lisp file (once loaded) to use it. Sometimes, once loaded, the author displays what you need to type in ordered to use that lisp file. If the name (minus the .lsp extension) doesn't work, and the author didn't inform you what to type, then you'll need to open the lisp file (either in VLIDE or NOTEPAD) and look at the (defun c: ) part. What comes after the c: is what you need to type to run the file (once loaded). Example:

 

C:SteelBeam ~ type steelbeam

C:RodShelf ~ type rodshelf

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...