Steven P Posted July 18 Posted July 18 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 July 18 Posted July 18 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
Strydaris Posted 21 hours ago Posted 21 hours ago @CivilTechSource I'm not as good at the whole CAD customization as some or maybe all of the guys in this thread but here is what I do at my office. 1) I get everyone to add a line to their Support File Search Path. The line I get them to add is located on our server so everyone has access to it. For example my line is "G:\Support_Files\Autolisp\_LoadOnStart" where the G:\ is a network drive and the Autolisp folder contains all our Autolisps. 2)I add the same folder into the Trusted Locations section. Or in this case I would just this line. "G:\Support_Files\Autolisp\..." The 3 periods at the end means also include every folder here after. 3) Once thats all setup then AutoCAD should start loading all acad.lsp & acaddoc.lsp or acadlt.lsp & acadltdoc.lsp when you start CAD or open a file. 4) I created an acadltdoc.lsp file and put my load, autoload or system variables in there. Here is a small snippet of what I load when users open a file.... Here is what I do for system variables and to make sure they are the same across the company. Doing this has helped and has decreased the amount of times I get asked why something isnt working. I have more variables then written here. This is just an example. ;;Set system variables that need to be set for Cassidy & Co CAD Standards (defun-q MYSTARTUP () (SETVAR "REGENMODE" 1) (SETVAR "GRIDMODE" 0);Turns off the grid (SETVAR "SNAPMODE" 0);Turns off snap to grid (SETVAR "MIRRTEXT" 0);Text will mirror (SETVAR "BINDTYPE" 1);Changes Xref Bind types. ie Setting to 1 will remove the xref files name from the layer name. (SETVAR "DIMASSOC" 1);Sets dims to be non-associated to objects (SETVAR "VISRETAIN" 1) (SETVAR "FILEDIA" 1);Yes (SETVAR "ATTDIA" 1);Yes (SETVAR "ATTREQ" 1);Yes (SETVAR "INSBASE" (list 0.0 0.0 0.0));Yes (SETVAR "SAVETIME" 10) (SETVAR "XREFNOTIFY" 2) (SETVAR "TRANSPARENCYDISPLAY" 1) (SETVAR "FIELDEVAL" 31) (PRINC) ) For LISP Routines I do this..... (setq S::STARTUP (append S::STARTUP MYSTARTUP)) (load "G:/Support_Files/Autolisp/SubFunctions.lsp") (load "G:/Support_Files/Autolisp/_LoadOnStart/TipV1-1.lsp") ;;Areas (autoload "G:/Support_Files/Autolisp/Area Calcs/Areas2AttributeV1-2.lsp" '("A2A")) (autoload "G:/Support_Files/Autolisp/Area Calcs/Areas2FieldV1-3.lsp" '("A2F")) The LOAD section will directly load the Lisps as the file loads. The AUTOLOAD section will load the lisp when the command at the end is written. For example if A2A or A2F typed out then the lisp will load and run the command. 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.