I have no idea why this function not work. (addSupportPath "C:\\Program Files\Autodesk Architectural Desktop 3\\TEST" 7) thanks John
Command: Command: (addSupportPath "C:\\Program Files\\Autodesk Architectural Desktop 3\\TEST" 7) ; error: no function definition: ADDSUPPORTPATH Command: (addSupportPath "C:\Program Files\Autodesk Architectural Desktop 3\TEST" 7) ; error: no function definition: ADDSUPPORTPATH Command: (addSupportPath "C:\\Program Files\Autodesk Architectural Desktop 3\TEST" 7) ; error: no function definition: ADDSUPPORTPATH
john, Do you have the function ? e.g. (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) ) Bob
No I thought Addsupoortpath is build in cad function. Command: (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) (_> ) ADDSUPPORTPATH Command: (addSupportPath "C:\\Program Files\\Autodesk Architectural Desktop 3\\TEST" 7) ; error: no function definition: STRPARSE Command: (addSupportPath "C:\Program Files\Autodesk Architectural Desktop 3\TEST" 7) ; error: no function definition: STRPARSE
In your first example, there was only 1 slash between "....Files\Autodesk..." now you have two. With that error sounds like the function isn't loaded/defined.
Heres what Im using: ------------ (VL-LOAD-COM) (SETQ ACADOBJ (VLAX-GET-ACAD-OBJECT)) (SETQ FILES (VLA-GET-FILES (VLA-GET-PREFERENCES ACADOBJ))) (SETQ OLDSUPPORT (VLA-GET-SUPPORTPATH FILES)) (SETQ NEWPATH (STRCAT OLDSUPPORT ";K:\Autodesk Architectural Desktop 3\Custom Menu")) (VLA-PUT-SUPPORTPATH FILES NEWPATH)) ------------
You also need: ;;;================================================================== ;;; (StrParse Str Delimiter) ;;; Parses a delimited string into a list ;;;------------------------------------------------------------------ ;;; Parameters: ;;; Str String to parse ;;; Delimiter Delimiter to search for ;;;------------------------------------------------------------------ ;;; Returns: ;;; A list strings. ;;; ex: ;;; (setq a "Harp,Guiness,Black and Tan") ;;; (StrParse a ",") ;;; returns: ;;; ("Harp" "Guiness" "Black and Tan") ;;;------------------------------------------------------------------ ;;; See Also: (StringToList) ;;;------------------------------------------------------------------ (defun strParse (Str Delimiter / SearchStr StringLen return n char) (setq SearchStr Str) (setq StringLen (strlen SearchStr)) (setq return '()) (while (> StringLen 0) (setq n 1) (setq char (substr SearchStr 1 1)) (while (and (/= char Delimiter) (/= char "")) (setq n (1+ n)) (setq char (substr SearchStr n 1)) ) ;_ end of while (setq return (cons (substr SearchStr 1 (1- n)) return)) (setq SearchStr (substr SearchStr (1+ n) StringLen)) (setq StringLen (strlen SearchStr)) ) ;_ end of while (reverse return) ) ;_ end of defun ......... Bob