I am having a problem loading LISP routines into multiple open drawings, in a new installation of AutoCAD Arch 2015.
I keep a many LSP routines in a separate directory in my c:\ drive (single user computer). I set up the trusted location to that directory the first time I opened 2015. Works great on the first drawing, but I am finding out that if I open a second drawing at the same time, it will not load my LSPs into that tab.
I tried appload, and it says "please select 50 or fewer files...." I want to be able to open all of them automatically on every drawing or block that I work on not just the fist file.
Thanks.
Solved! Go to Solution.
Solved by scot-65. Go to Solution.
Solved by Kent1Cooper. Go to Solution.
Solved by chauhuh. Go to Solution.
I've been fooling around with this for a bit on my own, and under appload, I can set a few of my most used LSPs into the "Startup Suite". That seems to work OK but again, it limits the number of routines. Any other ideas?
Create one lisp program that defines a two or three letter alias to load each lisp program. Add this program to startup suite then just type the alias to load what you need. Here is a sample of what the lisp program would look like to define alias commands...
;** AUTO SHEET NUMBERING **
(defun C:nm ()
(load "name")
)
;--------------------------------------------------------------
;** CHANGE LIST ATTRIBUTES TO TEXT **
(defun C:lt ()
(load "l2text")
)
;--------------------------------------------------------------
;** INSERT BLOCK NAME AS TEXT **
(defun C:ft ()
(load "fstext")
)
;--------------------------------------------------------------
;** CHANGE TEXT STYLE **
(defun C:ts ()
(load "ctstyle")
)
Or if you don't need an alias for loading each one seperately just have all the load commands in the lisp and it will load them all in at once.
@Jim wrote:
I've been fooling around with this for a bit on my own, and under appload, I can set a few of my most used LSPs into the "Startup Suite". That seems to work OK but again, it limits the number of routines. Any other ideas?
Use chauhuh's suggestion of putting the loading of them into an acaddoc.lsp file. That will load them in every drawing you open. It can contain any number of (load) and/or (autoload) functions:
(load "lispfile1")
(load "lispfile2")
(autoload "lispfile3" '("commandA" "commandB"))
With a large number of files defining commands, I recommend the (autoload) approach rather than (load), because it will save time on opening drawings, since it doesn't actually load any file unless and until a command name that is defined in it is called for by the User.
I do have an "acad.lsp" file with about 50% of my routines. This is one of the files I inserted into the "startup suite" and worked flawlesly. I will have to edit it or mybe it is time for me to revisit some of these routines. Some are quite old.
Thanks for your suggestions. I appreciate it.
@Jim wrote:
I do have an "acad.lsp" file ....
Note the difference between acad.lsp and acaddoc.lsp. The former loads only when you open AutoCAD, unless you set the ACADLSPASDOC System Variable to have it load in every drawing, but that's a kind of work-around -- Help about the acad.lsp file recommands using acaddoc.lsp for that, which loads with every drawing [or "document" -- that's what the doc means] you open or create, regardless of any System Variable settings. It doesn't need to be in the Startup suite. If you don't have one yet, you can make one, and put it in any location in the Support File Search Path list.
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.