See the top rated post in this thread. Click here

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

Thread: Get the current support paths and add new paths

  1. #1
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Get the current support paths and add new paths

    I just wanted to share this with everyone. It will get the current support paths and add new paths.

    Code:
    (SETQ ORIGPATH (STRCAT (GETENV "ACAD")";"))
    (SETQ ONEPATH (STRCAT "E:\\BMP;E:\\PROJECTS\\SSS;E:\\PROJECTS\\OUR_BLOCKS;E:\\PROJECTS\\OUR_BLOCKS\\Symbol_List;"));ADD PATHS HERE, NOT TO MANY OR IT GETS CUT OFF
    (SETQ TWOPATH (STRCAT "E:\\lisp;E:\\lisp\\LAYER-COLOR;E:\\lisp\\New_PANELS;"));ADD MORE HERE
    (SETQ THREEPATH (STRCAT "E:\\lisp\\NOT USED;E:\\PROJECTS\\OUR_BLOCKS\\Symbols;E:\\PROJECTS\\scripts;E:\\FONTS\\SHX;E:\\lisp\\lisp;C:\\Program Files\\Autodesk\\Migration Tools;"));ADD MORE
    (SETQ FOURPATH (STRCAT "E:\\lisp\\lisp\\BLK-INS"));ADD MORE HERE,NOTE - NO SEMI COL AT THE END
    
    (SETQ MYENV (STRCAT ORIGPATH ONEPATH TWOPATH THREEPATH FOURPATH))
    
    (SETENV "ACAD" MYENV)
    
    (strlen (getenv "ACAD"));DON'T GO OVER 800 OR BAD THINGS HAPPEN
    Let me know if this helps or if there are any improvements that can be made.

    Chris

  2. #2
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,809
    Login to Give a bone
    0

    Default Re: Get the current support paths and add new paths

    You can also do it using the ActiveX object library as shown in this post [ http://forums.augi.com/showthread.ph...43797#poststop ]
    R.K. McSwain | CAD Panacea |

  3. #3
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,119
    Login to Give a bone
    0

    Default Re: Get the current support paths and add new paths

    Quote Originally Posted by FRAMEDNLV
    I just wanted to share this with everyone. It will get the current support paths and add new paths.

    Code:
    (SETQ ORIGPATH (STRCAT (GETENV "ACAD")";"))
    (SETQ ONEPATH (STRCAT "E:\\BMP;E:\\PROJECTS\\SSS;E:\\PROJECTS\\OUR_BLOCKS;E:\\PROJECTS\\OUR_BLOCKS\\Symbol_List;"));ADD PATHS HERE, NOT TO MANY OR IT GETS CUT OFF
    (SETQ TWOPATH (STRCAT "E:\\lisp;E:\\lisp\\LAYER-COLOR;E:\\lisp\\New_PANELS;"));ADD MORE HERE
    (SETQ THREEPATH (STRCAT "E:\\lisp\\NOT USED;E:\\PROJECTS\\OUR_BLOCKS\\Symbols;E:\\PROJECTS\\scripts;E:\\FONTS\\SHX;E:\\lisp\\lisp;C:\\Program Files\\Autodesk\\Migration Tools;"));ADD MORE
    (SETQ FOURPATH (STRCAT "E:\\lisp\\lisp\\BLK-INS"));ADD MORE HERE,NOTE - NO SEMI COL AT THE END
    
    (SETQ MYENV (STRCAT ORIGPATH ONEPATH TWOPATH THREEPATH FOURPATH))
    
    (SETENV "ACAD" MYENV)
    
    (strlen (getenv "ACAD"));DON'T GO OVER 800 OR BAD THINGS HAPPEN
    Let me know if this helps or if there are any improvements that can be made.

    Chris
    Shouldn't you check for the length of the string prior to setting the environment variable?
    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
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Re: Get the current support paths and add new paths

    RK,
    Thanks for the link.

    Opie,
    Which string? Are you referring to the total acad env or the current?

    From what I read the total (strlen (getenv "ACAD")) should not exceed 800 characters.

    I did try reseting the acad env by setting it to blank (SETENV "ACAD" "" ) and then adding the new paths. When I set it to blank AutoCAD will add the default support paths.

    So far it seems to be working in our mixed AutoCAD environment. No duplicate paths are being updated.

    Chris

  5. #5
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,119
    Login to Give a bone
    0

    Default Re: Get the current support paths and add new paths

    Quote Originally Posted by FRAMEDNLV
    RK,
    Thanks for the link.

    Opie,
    Which string? Are you referring to the total acad env or the current?

    From what I read the total (strlen (getenv "ACAD")) should not exceed 800 characters.

    I did try reseting the acad env by setting it to blank (SETENV "ACAD" "" ) and then adding the new paths. When I set it to blank AutoCAD will add the default support paths.

    So far it seems to be working in our mixed AutoCAD environment. No duplicate paths are being updated.

    Chris
    I was referring to querying the length of the path after you reset it with the additional paths. If your additional paths make the Support Paths be larger than the limit, shouldn't you know that prior to resetting the environment variable?
    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

  6. #6
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Re: Get the current support paths and add new paths

    I thought about it for a while and decided to do as you suggested. I'll add the condition in the morning.

    If there doesn't seem to be any other problem with it I'm going to add it to our acad.lsp in the morning.

    Basically I'm setting the lisp for new and old cad stations. I still have a lot to work out (pc3 paths is going to be next).

    Chris

  7. #7
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,119
    Login to Give a bone
    0

    Default Re: Get the current support paths and add new paths

    Quote Originally Posted by FRAMEDNLV
    I thought about it for a while and decided to do as you suggested. I'll add the condition in the morning.

    If there doesn't seem to be any other problem with it I'm going to add it to our acad.lsp in the morning.

    Basically I'm setting the lisp for new and old cad stations. I still have a lot to work out (pc3 paths is going to be next).

    Chris
    Shouldn't you verify those paths are not already in the support paths?
    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

  8. #8
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,809
    Login to Give a bone
    0

    Default Re: Get the current support paths and add new paths

    Quote Originally Posted by Opie
    Shouldn't you verify those paths are not already in the support paths?
    That's why in my method, I don't grab what's currently there and append it, I just set the entire path.
    R.K. McSwain | CAD Panacea |

  9. #9
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,119
    Login to Give a bone
    0

    Default Re: Get the current support paths and add new paths

    Quote Originally Posted by rkmcswain
    That's why in my method, I don't grab what's currently there and append it, I just set the entire path.
    I realise that. But I think the OP wanted to have the ability to append it to the current list. Not the best approach for an office. I would rather have everyone have the same paths as well.
    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

  10. #10
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Re: Get the current support paths and add new paths

    I didn't have any duplicate path problems while testing it. My current support paths have some of the ones that are being added, but they don't seem to duplicate.



    Chris

Page 1 of 2 12 LastLast

Similar Threads

  1. 2015: Support Paths Not Holding
    By Iceberg in forum AutoCAD Customization
    Replies: 7
    Last Post: 2014-09-16, 02:50 PM
  2. ACAD.lsp for support paths
    By zride91 in forum AutoLISP
    Replies: 6
    Last Post: 2012-06-28, 05:15 PM
  3. Relative Paths back to Full Paths Kind a rush thing
    By ReachAndre in forum AutoLISP
    Replies: 1
    Last Post: 2007-10-25, 11:21 PM
  4. Change full paths to relative paths?
    By RCA4697 in forum AutoCAD General
    Replies: 11
    Last Post: 2006-05-31, 02:19 AM

Posting Permissions

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