aawilds Posted June 8, 2017 Posted June 8, 2017 Hello, I have a question for all those lisp masters out there. The company that I work for has had me learning and creating lisp for them for a couple months now and we are starting to get a library of lisp built up. Currently I have all of the lisp being loaded at startup through the appload command. I have decided to use Lee Mac's Autoloader when necessary, but I was wondering at how many lisp would it be wise to do that for instead of at startup? Right now the PCs in the office are not filling slow (They are what I would consider to be in the middle of the road in power.). Quote
BIGAL Posted June 9, 2017 Posted June 9, 2017 Just me others will make comment For years I just demand loaded as required from menus, then some shortcuts again these can load a bigger lisp. (defun c:zzz (load "myzzz")) I started to put together a library lisp this held my shortcuts and the common code used by various routines this was to meet office standards. I have changed a bit now still demand load but a simple method of checking is the defun available if not load the lisp required. Again these are library lisps but not in one great big file. (if (not AH:getval2) (load "getvals3")) (ah:getval2 "Please enter Pit L m: " 6 5 "0.9" "Please enter Pit W " 6 5 "0.6") Quote
tombu Posted June 9, 2017 Posted June 9, 2017 I have about a half dozen routines that load on startup, all the rest are loaded in macros similar to BIGAL ^C^C^P(or C:ld (load "leader.lsp"));ld Since or only evaluate until it finds one True it doesn't evaluate (load "leader.lsp") if C:ld has been defun already. Then starts the ld arc leader lisp command. I've got two full custom Ribbon tabs loaded with lisp macros, not sure how well AutoCAD would run if half of them were loaded at the same time. Quote
BIGAL Posted June 10, 2017 Posted June 10, 2017 tombu like the "or" but will stay with "not" as I will confuse myself. Confused enough already. Quote
tombu Posted June 10, 2017 Posted June 10, 2017 tombu like the "or" but will stay with "not" as I will confuse myself. Confused enough already. Someone (Robert Bell maybe) showed me that trick about 20 years ago. Helped me remember how useful the "or" function can be. Quote
aridzv Posted May 9 Posted May 9 (edited) Regarding the OP question: I recently switched to using "autoload" instead of appload because I felt the loading time for drawings was a bit long. I have about 60 lisp's to load. I entered in my on_doc_load.lsp (bricscad,for autocad it's acaddoc.lsp if i remember correctly) "autoload" statment for every lisp I wanted to load, again - about 60 lines. The drawings load faster, the change is definitely noticeable. aridzv. Edited May 9 by aridzv Quote
tombu Posted May 9 Posted May 9 2 hours ago, aridzv said: Regarding the OP question: I recently switched to using "autoload" instead of appload because I felt the loading time for drawings was a bit long. I have about 60 lisp's to load. I entered in my on_doc_load.lsp (bricscad,for autocad it's acaddoc.lsp if i remember correctly) "autoload" statment for every lisp I wanted to load, again - about 60 lines. The drawings load faster, the change is definitely noticeable. aridzv. Great way for lisp you use all the time but when you have a huge amount of lisp files having the one's you normally call from the Ribbon or a Toolbar or don't use daily load as you need them load on demand uses less resources and is easier to maintain. There's be changes to how lisp worked over the years that required them to be updated to function in newer versions especially when they used AutoCAD commands that had been modified. My acaddoc.lsp loads 12 lisps and defines 12 more but most of the lisp I use loads on demand. Quote
aridzv Posted May 9 Posted May 9 (edited) @tombu "autoload" is by defenition load on demand - that's the idea with "autoload". the lisp is not loaded untill you call the command in the lisp. Edited May 9 by aridzv 1 Quote
tombu Posted May 9 Posted May 9 2 minutes ago, aridzv said: @tombu "autoload" is by defenition load on demand - that's the idea with "autoload". the lisp is not loaded untill you call that lisp. Sorry I though you were loading it with your on_doc_load.lsp instead of using autoload calls in it. I've done the same thing. ACADDOC.LSP 1 Quote
BIGAL Posted May 10 Posted May 10 In Bricscad you can use Appload and save a custom lisp containing all your shortcuts, yes use Autoload within that lisp, for me I use custom lisps rather than play with the default lisps, this works for Autocad as well, Appload add to Start up suite. Just a side comment did a post yesterday about making a Install.lsp to do just that and it is possible to find what the load on start up currently are, then add a new one. (setq ver (vl-registry-read "HKEY_CURRENT_USER\\Software\\Bricsys\\BricsCAD" "CURVER")) (setq val (strcat "HKEY_CURRENT_USER\\Software\\Bricsys\\BricsCAD\\" ver "\\en_US\\Profiles\\Default\\Config")) (setq suppath (vl-registry-read val "SRCHPATH")) 1 Quote
aridzv Posted May 10 Posted May 10 apparently I was wrong about bricscad "appload" behavior - it dose use autoload and not load. the reason for the delay I experienced was using appload to load a certain .brx file. I moved the load line in to the lisp that use it and the loading went back to be fast, except,of course ,the first time that specific lisp is called. After the first call this command is also fast. and yes - I'm awere of bricscad appload.dfs that holds the appload list to autoload... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.