Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Loading LSPs in multiple open drawings in AutoCAD 2015.

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
jim
Contributor
725 Views, 7 Replies

Loading LSPs in multiple open drawings in AutoCAD 2015.

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.

7 REPLIES 7
Message 2 of 8
chauhuh
in reply to: jim

You could load them from acaddoc.lsp or one of the startup lsp files.

Message 3 of 8
jim
Contributor
in reply to: jim

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?

Message 4 of 8
M_Hensley
in reply to: jim

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.

Message 5 of 8
Kent1Cooper
in reply to: jim


@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.

Kent Cooper, AIA
Message 6 of 8
jim
Contributor
in reply to: Kent1Cooper

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.

Message 7 of 8
Kent1Cooper
in reply to: jim


@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.

Kent Cooper, AIA
Message 8 of 8
scot-65
in reply to: Kent1Cooper

A fix for the concern by Kent in his last paragraph is to go ahead and use load in this manner:

(defun c:AA () (load "AA")(c:AA)) ;brief comment what routine does

This way the command line does not show all the noise that autoload creates the first time the routine is called, the keystroke is defined, and subsequently the loading of the routine at first call will overwrite the initial keystroke definition (program is not being loaded over and over again).

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


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost