Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Acad.lsp file

127 views
Skip to first unread message

Leo Montero

unread,
Apr 14, 1999, 3:00:00 AM4/14/99
to
I often come across lisp routines that I find very helpful and use often
while running AutoCAD. Instead of having to load one of these routines
with the Load App command every time I open a new drawing I started
editing my acad.lsp file.
I would just paste the desired lisp file to the end of my acad.lsp file.
Can someone tell me if I'm going about this the right way, or wrong way?
My acad.lsp file is getting rather large so I thought I'd better ask.

Thanks in advance,

Leo Montero


Keith

unread,
Apr 14, 1999, 3:00:00 AM4/14/99
to
Leo,

in your acad.lsp, there should be a "autoload LISP applications" section and
at the end you can just type in "(LOAD
"C:\\.............\\..............\\...........\\insert.lsp"). Make sure
you use the two slashes and if the directories are in long name format, make
sure you use the MS-DOS path name, and also the same with the LISP file.
Hope this helps

--
Remove ".ns" to email me

Keith Kempker

Leo Montero wrote in message <3714A7B6...@llnl.gov>...

Richard Binning

unread,
Apr 14, 1999, 3:00:00 AM4/14/99
to
Or use your acad.lsp to preload shortcuts/macros so that you don't actually
load the full lisp routine until it is actually needed...see example below.

(defun c:ga (/);define 2-key macro
(prompt "\nMacro: Running Extended Attribute Editor--Gatcha...");tell the
user
(if (not c:gatcha);if gatcha.lsp is not loaded then gatcha function
undefined
(load "w:\\thc\\y\\gatcha");therefore load it here
);close if
(c:gatcha);call gatcha function
);end 2-key macro definition

--
Richard Binning
rlbi...@thehaskellco.com
"America's Design-Build Leader"

Leo Montero <mont...@llnl.gov> wrote in article

Lila

unread,
Apr 14, 1999, 3:00:00 AM4/14/99
to
Wow, that's a whole lot of code for something so simple. I
guess it's programatically correct, but if you have 20
macros to define you'd end up with a horrendous looking
acad.lsp. Here's an excerpt from my acad.lsp. Please note
that if you load *without* the path you will need to put the
lisp routine's somewhere where AutoCAD is already looking.
I created a "lisp" subdirectory on the server and made sure
everyone in our office has that directory in their search
path.

I used these three examples specifically because the last
set of () contain the three different things that might be
needed depending on how the lisp you're loading was written.

(DEFUN C:ae()(COMMAND "area" "e")(princ))
(defun c:bl()(load "bl")(c:bl))
(DEFUN C:BM()(LOAD "BLIP")(BLIP))


--
***Please remove "XXX" from email address when responding
directly***
---
Richard Binning wrote in message
<01be8694$249e79c0$7c040196@3073b-h303807>...

Rob Starz

unread,
Apr 14, 1999, 3:00:00 AM4/14/99
to
This is and answer and into acad.lsp:

When I first started to customize my Autocad and I loaded up ACAD.lsp to the
hilt. Then I found out how to load the routines on demand.

(defun c:myapp()(load "myapp")(c:myapp)) ; <----located in acad.lsp

Once I started to separate the macros into there own file and assoc code in
acad.lsp
Autocad started to load faster. Try not to tax your system with code that is
only use once in awhile.

Finally...(I may get some flack for this)
I would never touch your acadr14.lsp file like some say to do. The reason
for this is if a patch or upgrade comes out for you version the acadr14.lsp
can be over written. "yeah but I can copy my old acadr14 over the new."
No!!! you can't because the acadr14 has some core information that upgrades
change sometimes.

That's my 2 cents. <Ducking>


--
Rob Starz
StarDsign
Plogv 2.0 (plot logging)
http://members.AOL.com/StarDsign/plog/index.htm


Joel

unread,
Apr 14, 1999, 3:00:00 AM4/14/99
to

Rob Starz <Star...@aol.com> wrote in article
<7f2i5l$6u...@adesknews2.autodesk.com>...


> This is and answer and into acad.lsp:
>
> When I first started to customize my Autocad and I loaded up ACAD.lsp to
the
> hilt. Then I found out how to load the routines on demand.
>
> (defun c:myapp()(load "myapp")(c:myapp)) ; <----located in acad.lsp
>
> Once I started to separate the macros into there own file and assoc code
in
> acad.lsp
> Autocad started to load faster. Try not to tax your system with code that
is
> only use once in awhile.
>
> Finally...(I may get some flack for this)
> I would never touch your acadr14.lsp file like some say to do. The
reason
> for this is if a patch or upgrade comes out for you version the
acadr14.lsp
> can be over written. "yeah but I can copy my old acadr14 over the new."
> No!!! you can't because the acadr14 has some core information that
upgrades
> change sometimes.
>
> That's my 2 cents. <Ducking>


Here is another 2 cents, along the same lines.

In my acad.lsp file I have a bunch of these...

(autoload "chglayer" '("chglayer"))

(autoload "glue" '("glue"))

(autoload "midpt" '("midpt"))

(autoload "chtext" '("cht"))....

so on and so forth.

I too do not mess with the acadr14.lsp file anymore as Rob suggested - but
because "autoload" happens to be defined there and all my extra lisp files
are pathed in my Support File Search Path, all I need to but in is the file
name and the command that starts it. Works like a charm. Some files are
already autoloaded this way from the acadr14.lsp file and I used to append
my files after them. Once I realized that I could put them in the acad.lsp
(and keep the acadr14.lsp file clean) I did so. As long as the search path
knows where to find your files, each line can be very short.

Joel

Roi Ledford

unread,
Apr 14, 1999, 3:00:00 AM4/14/99
to
Lila <XXX...@resistanceisfutile.com> wrote in message
news:7f2gpa$6u...@adesknews2.autodesk.com...

> Wow, that's a whole lot of code for something so simple. I
> guess it's programatically correct, but if you have 20
> macros to define you'd end up with a horrendous looking
> acad.lsp.

Richard liberally commented it so it does look like a lot.

>
> (DEFUN C:ae()(COMMAND "area" "e")(princ))
> (defun c:bl()(load "bl")(c:bl))
> (DEFUN C:BM()(LOAD "BLIP")(BLIP))
>

Problem with last 2 is the .lsp is loaded everytime it used and not just
once.

Better, test for each function prior to loading

(defun c:bl()(if (null bl)(load "bl"))(c:bl))
(DEFUN C:BM()(if (null BLIP)(LOAD "BLIP"))(BLIP))

That's not too horrendous is it :)


--

Have a day :|
---------------------------
Roi Ledford
mailto:r...@npda.com

-snip-

0 new messages