rtlflat Posted January 8, 2018 Share Posted January 8, 2018 I was wanting to know best way to go about "linking" separate copies of lisp to specific drawings. I have drawings grouped in folders and would like to be able tweak the lisp for a group separately brainstorming on it a bit it seems best way to go about this would be to write a lisp routine that automatically loads when a drawing is opened, and then loads the proper lisp from a relative path. Folder1 -drawing1.dwg -LISP -lisp.lsp Folder2 -drawing2.dwg -LISP -lisp.lsp ^^^ so for folder hierarchy above would mean opening drawing1.dwg would cause the lisp routine to open LISP/lisp.lsp in the Folder1 tree but opening drawing2.dwg opens LISP/lisp.lsp under Folder2 tree Is this method a logical route to take or is there a more efficient way to get same result? or a script as opposed to a lisp routine? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 8, 2018 Share Posted January 8, 2018 From your description, the easiest way that I see to achieve this (with no hardcoding of paths/filenames) would be to include an acaddoc.lsp in each drawing folder to load the appropriate programs; this exploits the fact that AutoCAD will search the working directory before any support file search paths and will only load the first acaddoc.lsp file found. Quote Link to comment Share on other sites More sharing options...
Grrr Posted January 8, 2018 Share Posted January 8, 2018 How about using something like this on startup: (defun LoadLispOnStart ( LispFileName / fnm ) (if (findfile (setq fnm (strcat (getvar 'dwgprefix) LispFileName ".lsp"))) (load fnm) (prompt "\nUnable to find \"" fnm "\" !") ) ) (LoadLispOnStart "Test") 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.