Hi, I got this off http://code.acadx.com anyone know where i actually put my support path? (defun addSupportPath (dir pos / tmp c lst) (setq tmp "" c -1 ) (if (not (member (strcase dir) (setq lst (mapcar 'strcase (strParse (getenv "ACAD") ";"))) ) ) (progn (if (not pos) (setq tmp (strcat (getenv "ACAD") ";" dir)) (mapcar '(lambda (x) (setq tmp (if (= (setq c (1+ c)) pos) (strcat tmp ";" dir ";" x) (strcat tmp ";" x) ) ) ) lst ) ) (setenv "ACAD" tmp) ) ) (princ) ) Cheers Bob T.
Bob, Not sure if this is what you mean, but you need to pass 2 arguments to the routine. dir - your folder to add pos - the position in the support path, ie: (addSupportPath "YourFolderName" 1) I think passing nil to pos will add the path to the end of the support path Steve
Bob, You don't add the arguments directly to the routine, you pass them to it. Use; (addSupportPath "C:\Path\mynewpath" 1) Steve
Sorry mate a bit new at this.... Ive created a lisp file called addsupportpath.lsp and added (addSupportPath "C:\Path\mynewpath" 1) to my acad.lsp file. Is this right cos i get ; error: no function definition: ADDSUPPORTPATH
the addsupportpath lisp has to be loaded before you can use it. (load "addsupportpath.lsp") (addSupportPath "c:\\myFolder" 2) My question is: How do you make an "IF" statement so that if the path already exists, to not add the support path?
I don't think so. In my support paths i have the following: L:\library\CAD\Autodesk\2000i\gen\menu\CADTOOL2 (addSupportPath "L:\LIBRARY\CAD\AUTODESK\2000I\GEN\MENU\CADTOOL2" 5) using the lisp. I get the following in my support paths under the CADTOOL2 reference. "Llibrarycadautodesk[some fancy pound sign]genmenucadtool2"
Use double slashes instead. \\ or / -- Best Regards, Jimmy B CAD and Database Developer Manager at www.pharmadule-emtunga.com Take a look at the trial version of SmartPurger (now for AutoCAD 2004) or download some freeware at www.jtbworld.com More on AutoCAD 2004; www.jtbworld.com/autocad2004.htm www.jtbworld.com/autocad2004tips.htm
I now have two paths listed in my support directory: L:\LIBRARY\CAD\AUTODESK\2000I\GEN\MENU\CADTOOL2 L:/LIBRARY/CAD/AUTODESK/2000I/GEN/MENU/CADTOOL2
still not working and its doing my nut!!! if i create a file call ed addsupportpath.lsp which contains:- (defun addSupportPath (dir pos / tmp c lst) (setq tmp "" c -1 ) (if (not (member (strcase dir) (setq lst (mapcar 'strcase (strParse (getenv "ACAD") ";"))) ) ) (progn (if (not pos) (setq tmp (strcat (getenv "ACAD") ";" dir)) (mapcar '(lambda (x) (setq tmp (if (= (setq c (1+ c)) pos) (strcat tmp ";" dir ";" x) (strcat tmp ";" x) ) ) ) lst ) ) (setenv "ACAD" tmp) ) ) (princ) ) Then i add:- (load "addsupportpath.lsp") (addSupportPath "c:\\myFolder" 2) .........to the end of my acad.lsp file, should it work or am i totally going wrong!!!
I would try it at the beggining of my .mnl file. The menus that load in the acad.lsp may be overriding the new settings. Also delete the old .mnc and .mnr files of any menus loaded at startup. Bill
(load "addsupportpath.lsp") (C:addSupportPath "c:\\myFolder" 2);needs C: for call to outside lisp file going wrong!!!
My bad. If it's not called C:addsupportpath in the lisp file then you don't need C: to call it. Do you get this error when you first start AutoCAD? You may need to go to. Assist/Options/System.......and CHECK "load acad.lsp with every drawing"