Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Add Support Paths via LISP

  1. #1
    Member
    Join Date
    2000-12
    Posts
    2

    Default Add Support Paths via LISP

    I know this must have been asked many times before but I need to add 2 or 3 support paths to the support folder search paths but I want to do this via a lisp routine that can be added to my acaddoc.lsp, the added folders need to be listed as the first folders in the search paths..any help.

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    6,836

    Default Re: Add Support Paths via LISP

    Have you seen the AutoLISP Forums? There is a recent thread, "Get the current support paths and add new paths" with this simple solution.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    6,836
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  4. #4
    Administrator Mike.Perry's Avatar
    Join Date
    2001-03
    Posts
    13,499

    Default Re: Add Support Paths via LISP

    Hi "david.5774" ( Sorry, I do not know your real name )

    Please note I have *moved* this thread from the AutoCAD General forum to this one, as I feel this particular forum is a more appropriate place for such a topic.

    Thanks, Mike

    Forum Manager

  5. #5
    Active Member
    Join Date
    2005-11
    Posts
    61

    Default Re: Add Support Paths via LISP

    What am I doing wrong here and how can I have it check to see if the path exists, and if it does, do not add it?

    (defun c:addpath ()
    (SETQ ORIGPATH (STRCAT (GETENV "ACAD")";"))
    (SETQ ONEPATH (STRCAT "C:\\TEST"))
    (SETQ MYENV (STRCAT ORIGPATH ONEPATH))
    (SETENV "ACAD" MYENV)
    (strlen (getenv "ACAD"))

  6. #6
    Certified AUGI Addict rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Houston
    Posts
    7,519

    Default Re: Add Support Paths via LISP

    Quote Originally Posted by rcroke
    What am I doing wrong here and how can I have it check to see if the path exists, and if it does, do not add it?
    See also:
    http://forums.augi.com/showthread.ph...43797#poststop

    Your (defun) is missing the closing parenthesis.

    To check for the existance of C:\TEST you can do this:

    Code:
    (vl-load-com)
    (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))
      (progn
        (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)
        )
      )
    )
    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.

    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.

  7. #7
    Active Member
    Join Date
    2005-11
    Posts
    61

    Default Re: Add Support Paths via LISP

    Thanks, that works fine.

  8. #8
    Member
    Join Date
    2000-12
    Posts
    2

    Default Re: Add Support Paths via LISP

    Thanks Opie your help is much appreciated.

  9. #9
    Member
    Join Date
    2010-02
    Posts
    16

    Default Re: Add Support Paths via LISP

    Thanks Rick, This will be very useful for me.
    Much appreciated
    ~Greg

  10. #10
    Member
    Join Date
    2001-11
    Posts
    5

    Default Re: Add Support Paths via LISP

    Op
    this may be just me but all the url's are not found.

Page 1 of 2 12 LastLast

Similar Threads

  1. Code Review: Local Support Paths Set via LISP
    By chillme1 in forum AutoLISP
    Replies: 3
    Last Post: 2008-08-08, 02:12 PM
  2. ADT 2008 Support Paths
    By dwe61 in forum CAD Management - General
    Replies: 6
    Last Post: 2007-10-04, 02:29 AM
  3. Support Paths/Profile Set via LISP
    By chillme1 in forum AutoLISP
    Replies: 6
    Last Post: 2007-06-05, 12:34 PM
  4. Get the current support paths and add new paths
    By framedNlv in forum AutoLISP
    Replies: 16
    Last Post: 2006-09-27, 04:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •