Jump to content

problems with loading lisp


salman

Recommended Posts

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.

Link to comment
Share on other sites

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
 )

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...