File Support Path

Discussion in 'AutoCAD' started by Max, Jun 17, 2004.

  1. Max

    Max Guest

    Hi

    I am making a installable menu system to distribute to my other workers here
    at work.

    One question,

    In one of my programs I need to add 'File Search path' in order for the
    program to work.

    Is there anyway to add a customized 'File Search Path' or will this always
    be a manual process?

    Thanks for the help.
     
    Max, Jun 17, 2004
    #1
  2. Max

    ECCAD Guest

    Max,
    This is what I use for a customer:

    (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)
    ); end function
    ;;
    ;;;==================================================================
    ;;; (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
    ;;
    ;; Add Delphi Toolkit to Support Path..IF not there..
    ;;
    (addSupportPath "C:\\DELPHITK" nil)
    ;;
     
    ECCAD, Jun 17, 2004
    #2
  3. Max

    Max Guest

    Thanks Bob!...I'll give it awhirl

    Max
     
    Max, Jun 17, 2004
    #3
  4. Max

    Chris Chiles Guest

    Bob, How do you set this lisp you to load multiple support paths?

    Thanks,
    Chris
     
    Chris Chiles, Feb 11, 2005
    #4
  5. Max

    ECCAD Guest

    Chris,
    Just add more of these:
    Like:
    (addSupportPath "C:\\MYBLOCKS" nil)
    (addSupportPath "C:\\NEW_STUFF" nil)

    Etc.
    Bob
     
    ECCAD, Feb 14, 2005
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.