Jump to content

Load again the latest lisp file loaded???


hosyn

Recommended Posts

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

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