acad.lsp files

acad.lsp files

Drewpan
Advisor Advisor
5,668 Views
4 Replies
Message 1 of 5

acad.lsp files

Drewpan
Advisor
Advisor

Hi Guys,

 

I am a VERY new AutoCAD learner - I am teaching myself at this site : https://www.mycadsite.com

and it is very good for me. I am NOT attending a school or University so this is NOT about you

doing my homework for me 🙂

 

Ok. Here is my problem. I wanted to create a lisp file that will display co-ordinates when I click on

a point on the screen. Done that.

 

I can load the lisp file at the command line and it works perfectly, so the next job is to load it

automagically when I fire up AutoCAD. To do this I have to create a file called acad.lsp which

I have done and looks like this:

 

(defun s::startup ()
 (load "LP2.LSP")
 (load "LP3.LSP")
 )

 

the instructions on how to I found here:

https://knowledge.autodesk.com/support/autocad/learn-explore/caas/sfdcarticles/sfdcarticles/Automati...

 

(Actually one of you very nice Community persons pointed me to it - thanks)

 

This should work, but the page then says "place it in the AutoCAD search path."

Ok - so where IS that or how do I find that?

 

Presumably where I installed AutoCAD is in the search path, but do I put acad.lsp there or somewhere else?

Where do I put the lsp files I created?

If I put acad.lsp and my custom files in the main AutoCAD directory then it will get pretty cluttered after a while.

 

I am also not sure if I should use the mystartup version of the acad.lsp file or not. At this point I am doing

straight forward CAD - nothing fancy.

 

When might I NEED to change over to the mystartup version?

What other applications might use S::STARTUP?

 

Thanks in advance guys

 

0 Likes
Accepted solutions (3)
5,669 Views
4 Replies
Replies (4)
Message 2 of 5

Kent1Cooper
Consultant
Consultant
Accepted solution

@Drewpan wrote:

.... 

This should work, but the page then says "place it in the AutoCAD search path."

Ok - so where IS that or how do I find that?

 

....

There's actually more than one....  Call up the OPTIONS command, and in its dialog box pick the Files tab, and then the Support File Search Path list [right at the top].  That shows all the places AutoCAD will search for such files.  You can tell from the folder names of some that they are special-purpose ones, but it looks in all of them, so theoretically you could put your acad.lsp file into any of them.  BUT I would recommend that you make your own folder  to keep such custom files in, and Add... that to this list.  That will make it much easier to upgrade to the next version, and following ones -- you won't have to plow through whichever of AutoCAD's own folders you put it in to find your own files among all of AutoCAD's, to copy them to a new location for the next version, but can simply add that same folder of your own to this list in OPTIONS in the next version.

Kent Cooper, AIA
0 Likes
Message 3 of 5

Ranjit_Singh
Advisor
Advisor
Accepted solution

acad.lsp is typically used for application specific settings and hence the startup option. That way when AutoCAD starts, you apply some settings at application level. See this. These do not need to be called in for every drawing that you will open during that AutoCAD session. However, a lisp to display co-ordinates might be more appropriate at drawing level? If so get rid of the startup function and call the routine from acaddoc.lsp. Now the function will load with every drawing that you open during the session. (ACADLSPASDOC will change this behavior, if needed).

As far as the search path, call OPTIONS and find a path that exists under Support Path  as well as Trusted locations (depending on SECURELOAD). Now move your lsp file to that path. Or you can add your path to both of those folders.

0 Likes
Message 4 of 5

scot-65
Advisor
Advisor
Accepted solution
More hints...
Develop a folder structure for your growing customizations.

MyMain
- Documentation
- LISP (all stand-alone LSP/FAS files).
- Menu (CUIX, MNL and MNR)
- Support (everything else - acaddoc.LSP, PAT, fonts, BMP, LIN, PSS, PGP, etc).
- Printer, etc.

Trusted locations: Append "\..." to the path up thru "MyMain" and all these
sub-folders will also be included.

You may also want to add a "Develop" sub-folder to the mix which will
include a "blank" DWG file inside. Launching this file will allow LOAD
to execute cleanly (especially if a DCL is involved).

S::STARTUP should be used for invoking AutoCAD commands during the
startup sequence, if needed. Otherwise investigate MNL and abandon
the startup suite.

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 5 of 5

Drewpan
Advisor
Advisor

Thanks for the help.

 

I thought it would work along the lines all you guys have suggested.

 

Cheers

 

0 Likes