Jump to content
hosyn

Load again the latest lisp file loaded???

Recommended Posts

hosyn

Hey guys

Are there approach for load again the latest lisp file loaded from some lsp file??o:)

Share this post


Link to post
Share on other sites
Emmanuel Delay

I have a .lsp file on my desktop that loads other useful lisp files.

 

(defun openuseful ( / )
 (load "...\\lisp\\cabling\\movetofrom.lsp")
 (load "...\\lisp\\alp\\alp3.lsp")
 (load "...\\lisp\\furn\\furn_v5.lsp")
 ...
)
(openuseful)

 

You can also make Autocad auto-load a list of files that you provide.

 

But lisp does not remember which function is on which file.

Like you cannot write a function

(defun detectCurrentLispFile (/) ... ) . That question would not make sense to lisp.

Share this post


Link to post
Share on other sites
rkmcswain
Hey guys

Are there approach for load again the latest lisp file loaded from some lsp file??o:)

 

What exactly do you mean?

 

Are you loading a lisp file, then while you're working, someone is updating the code and you want to load it as soon as the file is updated?

Share this post


Link to post
Share on other sites
hosyn
What exactly do you mean?

 

Are you loading a lisp file, then while you're working, someone is updating the code and you want to load it as soon as the file is updated?

 

Yup, this is exactly what I need. (after updating code)

Share this post


Link to post
Share on other sites
rkmcswain

And you want it to do this automatically, with no human interaction?

 

I suppose you'll need a reactor, and a function that can read the file dates. (some examples here possibly)

 

1. Load the function, and read/store the file date on the file.

2. Have the reactor check the file every so often (30 sec?), and if the file date/time is newer, repeat step 1.

Share this post


Link to post
Share on other sites
Steven P

I use this:

 

 

(defun c:appreload ()
;;Re-load named LISP files

(setq mylispfolder "c:\\Users\\.....\\......\\")

 (setq myfiles (vl-directory-files mylispfolder "*.lsp" nil)) ;;myfiles is list of files in mylispfolder location
 (setq mylistlength (length myfiles)) ;;count of number of lsp files

 (setq acount -1)
 (repeat mylistlength
   (setq acount (1+ acount))
   (setq FailedtoLoad (strcat (nth acount myfiles) " failed to load"))
   (load (strcat mylispfolder (nth acount myfiles)) FailedtoLoad) ;;Loads each LISP file
 )
)

 

 

which will load all the LISP files within a location. I use it when I have updated a LIPS 'appreload' and its reloads (I have a folder with all my LISPS in it)

 

However it won't reload a LISP file as soon as its been updated you still need to type in the command. For al the time that takes and the time it would take to research and write a code to do this automatically is it worth the effort?

Share this post


Link to post
Share on other sites
BIGAL

If your writing and testing just make a temporary defun takes about 30 seconds.

 

(defun c:aaa ()(load "mynewprogram"))

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×