Support Path

Discussion in 'AutoCAD' started by BobBuilder, Dec 23, 2003.

  1. BobBuilder

    BobBuilder Guest

    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.
     
    BobBuilder, Dec 23, 2003
    #1
  2. BobBuilder

    Steve Jones Guest

    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
     
    Steve Jones, Dec 23, 2003
    #2
  3. BobBuilder

    BobBuilder Guest

    so i would do:-
    Is this right or am i talking crap!!
     
    BobBuilder, Dec 23, 2003
    #3
  4. BobBuilder

    Steve Jones Guest

    Bob,

    You don't add the arguments directly to the routine, you pass them to it.
    Use;

    (addSupportPath "C:\Path\mynewpath" 1)

    Steve
     
    Steve Jones, Dec 23, 2003
    #4
  5. BobBuilder

    BobBuilder Guest

    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
     
    BobBuilder, Dec 23, 2003
    #5
  6. BobBuilder

    BillZ Guest

    Try
    (load "addSupportPath")

    in the line before.

    Bill
     
    BillZ, Dec 23, 2003
    #6
  7. BobBuilder

    BobBuilder Guest

    soory, not sure what you mean??
     
    BobBuilder, Dec 23, 2003
    #7
  8. BobBuilder

    The real JD Guest

    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?
     
    The real JD, Dec 23, 2003
    #8
  9. My question is:
    WCMATCH
     
    Rick Francken, Dec 23, 2003
    #9
  10. Doesn't the code already account for that?
     
    Jason Piercey, Dec 23, 2003
    #10
  11. BobBuilder

    The real JD Guest

    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"
     
    The real JD, Dec 23, 2003
    #11
  12. 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


     
    Jimmy Bergmark, Dec 23, 2003
    #12
  13. BobBuilder

    The real JD Guest

    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


     
    The real JD, Dec 23, 2003
    #13
  14. BobBuilder

    The real JD Guest

    Oh the double slashes worked!
    And I guess it does have checking!
    I only see one instance.
    THx

     
    The real JD, Dec 23, 2003
    #14
  15. BobBuilder

    BobBuilder Guest

    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!!!
     
    BobBuilder, Jan 7, 2004
    #15
  16. BobBuilder

    BillZ Guest

    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
     
    BillZ, Jan 7, 2004
    #16
  17. BobBuilder

    BobBuilder Guest

    not using an mnl file, loading them from the acad.lsp
     
    BobBuilder, Jan 7, 2004
    #17
  18. BobBuilder

    Dann Brower Guest

    (load "addsupportpath.lsp")
    (C:addSupportPath "c:\\myFolder" 2);needs C: for call to outside lisp file



    going wrong!!!
     
    Dann Brower, Jan 7, 2004
    #18
  19. BobBuilder

    BobBuilder Guest

    i get :-

    ; error: no function definition: C:ADDSUPPORTPATH

    any ideas?
     
    BobBuilder, Jan 7, 2004
    #19
  20. BobBuilder

    Dann Brower Guest

    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"
     
    Dann Brower, Jan 7, 2004
    #20
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.