Hay everyone,
I was just after everyones opinion on whether its best to add all ones customs lisps to the acad.lsp or keep them seperate and just add the line (load "blah blah.lsp" " ") to acad.lsp?
|
Hay everyone,
I was just after everyones opinion on whether its best to add all ones customs lisps to the acad.lsp or keep them seperate and just add the line (load "blah blah.lsp" " ") to acad.lsp?
First off, it doesn't do any good to use "acad.lsp", because this file is only load once per session*. Lisp files must be loaded for each drawing that is loaded. "acaddoc.lsp" loads once per drawing, you should use this instead.Originally Posted by Mr Cory
I would suggest using the externally defined (autoload) function to load your lisp files in "acaddoc.lsp". This way the file doesn't actually load until it's needed. For more information, look up "autoload" in the Help file (acad_dev.chm).
If you are not going to do that, then it doesn't really matter which method you choose. For the record, almost all our lisp functions are stored in separate files, with the exception of "universal" small routines like DTR, RTD, which are defined in "acaddoc.lsp".
* unless ACADLSPASDOC is set to 1, which it shouldn't be
R.K. McSwain | CAD Panacea |
O right, well beasically at the moment i have all my lisps either in acad.lsp of loaded from it. I have "load acad.lsp with every drawing" so you think i need to change how things are set up?
I dont use acad.lsp, I just load everything through acaddoc.lsp using a combination of load and autoload.
AutoCAD is designed so that acad.lsp is used to load items that need to be loaded "once per session", and acaddoc.lsp is used to load items that need to be loaded "once per drawing"Originally Posted by Mr Cory
You are using "acad.lsp" like it was back in R14 and earlier, before AutoCAD introduced MDI.
More Info: http://rkmcswain.blogspot.com/2006/0...setup-and.html
R.K. McSwain | CAD Panacea |
I have all of my lisp routines loaded in the startup suite.
That may be why CAD loads somewhat slow.
Judging by the comments, I am guessing it is not the best way
to load routines.
But hey, it works!
I don't know about slow, but the Startup Suite has had problems since it was introduced. For some it fails to load some items, for others it loads items twice. It's not as easy to migrate that list at upgrade time either, not to mention difficulties in a multiple user environment.Originally Posted by Robert.Hall
R.K. McSwain | CAD Panacea |
All very good points. I find that some routines have not loaded. Does not bother me too much because I rarely lose a routine that I use often.Originally Posted by rkmcswain
In addition to your cons, startup suite limits the number of lisp files you can load on the "add a file" screen. The user cannot surf to a directory, select all, and then add the entire folder. The lisp files would need to be added in small groups.
I simply load mine lisp rotines when i need them...
"appload" and save them in "Startup Suite"
Cheers,
I have custom menus (.mns, .cui, .mnl) which I use to load all my lisp routines. I have two. One loads all the shared subs, and one loads all the lisp files with (autoload ...... The .mnl files are the ones used to load the lisps and subs.