PDA

View Full Version : loading and autoloading selected lisp files



spartan_cad
9th Aug 2005, 03:07 pm
I've recently written up a series of Lisp programs to help me automate the drawing process here at work. However, because i find it tedious, and to help get everyone else start using them, i'd like to know how to do either one of these things:

1) get autocad to automatically load all pertinent lisp files. I've tried loading all my lisps together, manually, but they seem to conflict with each other. If they conflict whenever they load together, possibly because of my choice of variables, it might be necessary for me to reprogram certain sections of my Lisps, but this is the ideal solution.

2) create macros (buttons in specific) to load and run individual lisp programs. I can use customized buttons to run preloaded lisps, but i dont know if there's a way of getting the macro to actually load the lisp on its own. This solution would avoid the problem of conflicting lisps entirely, but i think it would be preferable for acad to load them automatically.

If it helps, i'm using R14 mostly, but i also run 2002 from time to time.

Any help would be greatly appreciated (by me and my boss :) )

Dann
9th Aug 2005, 03:25 pm
Always localize variables

(defun C:commandname(/ var1 var2 var3)
(program body)
)

CarlB
9th Aug 2005, 08:59 pm
Regarding your question #2 - yes you can load lisps with a button macro. Something like;
^C^C(load "somelispfile");text_to_start

You still might have conflicts if you use/load a few routines which have the conflict problem.

spartan_cad
11th Aug 2005, 01:08 pm
thanks for the help

i spent a few minutes modifying my programs, localising the variables, and trying to ensure that they dont conflict anymore.

thanks for the tip about the button macros, i'll try that out as soon as i get some spare time for programming.