addSupportPath

Discussion in 'AutoCAD' started by John, May 19, 2004.

  1. John

    John Guest

    I have no idea why this function not work.

    (addSupportPath "C:\\Program Files\Autodesk Architectural Desktop 3\\TEST"
    7)


    thanks

    John
     
    John, May 19, 2004
    #1
  2. Check your slashes \ vs \\

    ?
     
    Jason Piercey, May 19, 2004
    #2
  3. John

    John Guest

    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, May 19, 2004
    #3
  4. John

    ECCAD Guest

    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
     
    ECCAD, May 19, 2004
    #4
  5. John

    JRWalker Guest

    Is addSupportPath your own routine?


     
    JRWalker, May 19, 2004
    #5
  6. John

    John Guest

    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
     
    John, May 19, 2004
    #6
  7. 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.
     
    Jason Piercey, May 19, 2004
    #7
  8. John

    F. Gump Guest

    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))
    ------------
     
    F. Gump, May 19, 2004
    #8
  9. John

    ECCAD Guest

    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
     
    ECCAD, May 20, 2004
    #9
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.
Similar Threads
Loading...