salman Posted June 17, 2010 Share Posted June 17, 2010 I have a number of lisp routines that I use in my day to day work. But I am facing a problem which is sometimes very painful. I cannot keep my lisp code in the office PC, so I load them from USB stick using a lisp file called LOADER, which contains code to load all the lisp routines. The format of LOADER file is like given below (load "j:/lisp/a.lsp") (load "j:/lisp/b.lsp") ...... Now the problem is that different computer detect the USB as different drives such as H:/ or G:/. So depending on the drive name I have to make changes to the lisp file LOADER. Secondly some lisp routines load other lisp routines to do their job so other than LOADER file I might need to modify code in other lisp routines also to avoid getting the LOAD error. Is their some solution for this issue. Thanks. Quote Link to comment Share on other sites More sharing options...
Freerefill Posted June 17, 2010 Share Posted June 17, 2010 Try this. This goes through the alphabet, looking for all drives that have a /lisp/ directory, and then it loads all the lisps in that directory. I don't think that's entirely what you want, but it's a start. (defun c:loadlots( / a b c) (foreach fv1 (abc) (if (setq a (vl-directory-files (strcat fv1 ":/lisp/") "*.lsp")) (foreach fv2 a (load (strcat fv1 ":/lisp/" fv2)) ) ) ) (princ) ) (defun abc( / a b) (setq a 64) (repeat 26 (setq b (cons (chr (setq a (1+ a))) b))) b ) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 17, 2010 Share Posted June 17, 2010 Hi Salman. My recommandations to you ,is to keep your Lisp files in a certain place in the drive c: or d: doesn't matter and use the command cui in Autocad to load all your Lisp normally as well as Autocad running . Regards, Tharwat Quote Link to comment Share on other sites More sharing options...
jammie Posted June 17, 2010 Share Posted June 17, 2010 There was a thread posted over on another website which may be of help http://www.theswamp.org/index.php?topic=32565.0 Regards Jammie Quote Link to comment Share on other sites More sharing options...
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.