Originally Posted by rcroke
Your (defun) is missing the closing parenthesis.
To check for the existance of C:\TEST you can do this:
That is not foolproof though, If you have a path such as C:\TEST\DIR\DIR, it would still find it because it's just searching for C:\TEST. I suppose you could test for C:\TEST;, but you can't count on the ";" being there if this is the last path in the list.
(setq *files* (vla-get-files (vla-get-preferences (vlax-get-acad-object))))
(SETQ ORIGPATH (vla-get-SupportPath *files*))
(SETQ ONEPATH (setq w ";C:\\TEST"))
(if (not (vl-string-search w ORIGPATH))
(SETQ MYENV (STRCAT ORIGPATH ONEPATH))
(if (< (strlen myenv) 1000); <- not sure why you are checking the length
; I've seen something referring to 800 chars
; but my normal path is over 900 and I have no problems
(vla-put-SupportPath *files* myenv)
Also, note that if you add a path that doesn't exist, it will show up in the OPTIONS dialog, but it will not show up when you query the current path via code.