Steven P Posted 6 hours ago Posted 6 hours ago 14 hours ago, BlackBox said: Since you're not using the return for vl-directory-files (just checking if it exists), findfile will be much faster: (defun _vl-directory-files (path /) (vl-directory-files path "*.*") ) (defun _findfile (path /) (findfile path) ) Quick benchmark: _VL-DIRECTORY-FILES Elapsed: 1391 Average: 0.1391 _FINDFILE Elapsed: 484 Average: 0.0484 In any event, here's a slightly simplified mod: (defun c:SetTrustedPaths (/ ) (foreach path (list "C:\\Users\\A Folder\\LISPs\\..." ) (_SetTrustedPaths path) ) (princ) ) (defun _SetTrustedPaths (path / trustedpaths) ;; folder check (if (not (findfile path)) (vl-mkdir path)) ;; trusted path check (if (vl-string-search (strcase path) (strcase (setq trustedpaths (getvar 'trustedpaths))) ) trustedpaths (setvar 'trustedpaths (strcat (if (= 59 (last (vl-string->list trustedpaths))) trustedpaths (strcat trustedpaths ";") ) path ) ) ) ) Cheers Thanks, that works better Quote
Steven P Posted 6 hours ago Posted 6 hours ago 7 hours ago, BIGAL said: @Steven P did trusted paths above including check if running Bricscad which does not have trusted paths. Another way to push lisps to a pc is you can via lisp unzip a ZIP file to a location, advantage is only one file rather than copying a whole directory. I use this as part of install lisps. Its super fast. Just need a "Filename" (startapp (strcat "powershell -command Expand-Archive -Path '" filename "' -DestinationPath 'C:/xxx-CAD-TOOLS' -FORCE")) (alert "programs unzipped to C:/xxx-CAD-TOOLS") Sorry BigAl, I was forgetting BricsCAD - I've never used it so no sure what it has and doesn't Quote
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.