+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
  1. #1
    Super Member MarcoW's Avatar
    Computer Details
    MarcoW's Computer Details
    Operating System:
    Microsoft Windows 7 Pro 64-bit
    Computer:
    A black one
    CPU:
    Intel Xeon E5520 Quad Core
    RAM:
    8 GB
    Graphics:
    NVIDIA Quadro FX 580 - 512MB
    Primary Storage:
    300 GB 10000 RPM
    Using
    AutoCAD 2011
    Join Date
    Apr 2009
    Location
    The Netherlands
    Posts
    599

    Default Need some help on this "Afralisp-routine" (to modify it...)

    Registered forum members do not see this ad.

    Click this link to see the whole routine:
    http://www.afralisp.net/archive/vl/acadset.htm

    THis part is where my question is:
    Code:
     
    ;;;=================================
    ;;;Set up the AfraLisp Support Paths
     
    ;set the path to the AfraLisp subdirectory.
    (setq netpath "C:\\AfraLisp2002")
     
    ;set the support paths to the AutoCAD default
    (setenv "ACAD" "")
     
    ;store the default paths
    (setq defpath (getenv "ACAD"))
     
    ;set up the AfraLisp paths
    (setenv "ACAD" (strcat 
    defpath ";"
    netpath ";"
    netpath "\\" "Menu;"
    netpath "\\" "CadLisp2k;"
    netpath "\\" "CadLib2k;"
    netpath "\\" "CadMech;"
    netpath "\\" "Hatching;"
    netpath "\\" "Help;"
    netpath "\\" "Profiles;"
    ))
     
    ;set up the custom template path
    (setenv "TemplatePath" (strcat netpath "\\" "Templates"))
     
    ;inform the user
    (prompt "\nAfraLisp Support Paths Defined\n")
     
    ;;;================
    How would I modify the code so my current search paths remain asthey are, so the new paths are to be added? I am in the middle of something but whenever I execute the routine, it copies the profile like it should but the SFSP's are overwritten with the new ones?

    Sorry if I am not totally clear... my goal is to keep the SFSP and ADD the new ones, not loose the old ones.

    Any help is appreciated, as allways.

    BTW: all credits to AfraLisp of course!!

  2. #2
    Forum Deity
    Using
    Civil 3D 2008
    Join Date
    Sep 2006
    Location
    Pittsburgh, PA, USA
    Posts
    3,581

    Default

    Have a look here on how to add a folder to your support path
    http://www.afralisp.net/visual-lisp/...isp-part-2.php

  3. #3
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,136

    Default

    Here's one I compiled for work...

    Code:
    (defun c:CES-Setup (/ #Files #Layout #Flag)
      (vl-load-com)
      (and
        (not
          (vl-catch-all-error-p
            (vl-catch-all-apply
              '(lambda ()
                 (setq #Files  (vla-get-files
                                 (vla-get-preferences (vlax-get-acad-object))
                               ) ;_ vla-get-files
                       #Layout (vla-get-activelayout
                                 (vla-get-activedocument (vlax-get-acad-object))
                               ) ;_ vla-get-activelayout
                 ) ;_ setq
                 ;; *********************
                 ;; **  AutoSave Path  **
                 ;; *********************
                 (mapcar 'vl-mkdir (list "c:\\TEMP" "c:\\TEMP\\ACAD"))
                 (vla-put-autosavepath #Files "c:\\TEMP\\ACAD")
                 ;; ***************************
                 ;; **  Printer Config Path  **
                 ;; ***************************
                 (vla-put-PrinterConfigPath
                   #Files
                   "s:\\cadd standards\\Plotters"
                 ) ;_ vla-put-PrinterConfigPath
                 (vla-refreshplotdeviceinfo #Layout)
                 ;; ***********************
                 ;; **  Plotstyles Path  **
                 ;; ***********************
                 (vla-put-printerstylesheetpath
                   #Files
                   "s:\\cadd standards\\Plotstyles"
                 ) ;_ vla-put-printerstylesheetpath
                 (vla-refreshplotdeviceinfo #Layout)
                 ;; *********************
                 ;; **  Template Path  **
                 ;; *********************
                 (vla-put-TemplateDwgPath
                   #Files
                   "s:\\cadd standards\\Template"
                 ) ;_ vla-put-TemplateDwgPath
                 ;; *********************
                 ;; **  QNew Template  **
                 ;; *********************
                 (vla-put-QNewTemplateFile
                   #Files
                   "s:\\cadd standards\\Template\\CES_Template.dwt"
                 ) ;_ vla-put-QNewTemplateFile
                 ;; *********************
                 ;; **  Support Paths  **
                 ;; *********************
                 (vla-put-supportpath
                   #Files
                   (strcat ";s:\\cadd standards\\startup"
                           ";s:\\cadd standards\\lisp"
                           ";s:\\cadd standards\\linetypes"
                           ";s:\\cadd standards\\fonts"
                           ";s:\\cadd standards\\ces layers"
                           ";"
                           (vla-get-supportpath #Files)
                   ) ;_ strcat
                 ) ;_ vla-put-supportpath
                 ;; ***************************
                 ;; **  Tool Palettes Paths  **
                 ;; ***************************
                 (vla-put-ToolPalettePath
                   #Files
                   (strcat "S:\\CADD Standards\\Toolpalette\\Palettes;"
                           (vla-get-ToolPalettePath #Files)
                   ) ;_ strcat
                 ) ;_ vla-put-ToolPalettePath
               ) ;_ lambda
            ) ;_ vl-catch-all-apply
          ) ;_ vl-catch-all-error-p
        ) ;_ not
        (alert
          (strcat
            "AutoCAD has been setup for Capital Engineering & Surveying, Inc. Standards.\n\n"
            "                      Please restart AutoCAD."
          ) ;_ strcat
        ) ;_ alert
      ) ;_ and
      (princ)
    ) ;_ defun
    (alert "Type: \"CES-SETUP\" to run setup.")
    (princ)
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  4. #4
    Super Member MarcoW's Avatar
    Computer Details
    MarcoW's Computer Details
    Operating System:
    Microsoft Windows 7 Pro 64-bit
    Computer:
    A black one
    CPU:
    Intel Xeon E5520 Quad Core
    RAM:
    8 GB
    Graphics:
    NVIDIA Quadro FX 580 - 512MB
    Primary Storage:
    300 GB 10000 RPM
    Using
    AutoCAD 2011
    Join Date
    Apr 2009
    Location
    The Netherlands
    Posts
    599

    Default

    Thanks guys!!

    Now let me do some homework tonight!!

  5. #5
    Super Member MarcoW's Avatar
    Computer Details
    MarcoW's Computer Details
    Operating System:
    Microsoft Windows 7 Pro 64-bit
    Computer:
    A black one
    CPU:
    Intel Xeon E5520 Quad Core
    RAM:
    8 GB
    Graphics:
    NVIDIA Quadro FX 580 - 512MB
    Primary Storage:
    300 GB 10000 RPM
    Using
    AutoCAD 2011
    Join Date
    Apr 2009
    Location
    The Netherlands
    Posts
    599

    Default

    Quote Originally Posted by alanjt View Post
    Here's one I compiled for work...

    Code:
    (defun c:CES-Setup (/ #Files #Layout #Flag)
      (vl-load-com)
      (and
        (not
          (vl-catch-all-error-p
            (vl-catch-all-apply
              '(lambda ()
                 (setq #Files  (vla-get-files
                                 (vla-get-preferences (vlax-get-acad-object))
                               ) ;_ vla-get-files
                       #Layout (vla-get-activelayout
                                 (vla-get-activedocument (vlax-get-acad-object))
                               ) ;_ vla-get-activelayout
                 ) ;_ setq
                 ;; *********************
                 ;; **  AutoSave Path  **
                 ;; *********************
                 (mapcar 'vl-mkdir (list "c:\\TEMP" "c:\\TEMP\\ACAD"))
                 (vla-put-autosavepath #Files "c:\\TEMP\\ACAD")
                 ;; ***************************
                 ;; **  Printer Config Path  **
                 ;; ***************************
                 (vla-put-PrinterConfigPath
                   #Files
                   "s:\\cadd standards\\Plotters"
                 ) ;_ vla-put-PrinterConfigPath
                 (vla-refreshplotdeviceinfo #Layout)
                 ;; ***********************
                 ;; **  Plotstyles Path  **
                 ;; ***********************
                 (vla-put-printerstylesheetpath
                   #Files
                   "s:\\cadd standards\\Plotstyles"
                 ) ;_ vla-put-printerstylesheetpath
                 (vla-refreshplotdeviceinfo #Layout)
                 ;; *********************
                 ;; **  Template Path  **
                 ;; *********************
                 (vla-put-TemplateDwgPath
                   #Files
                   "s:\\cadd standards\\Template"
                 ) ;_ vla-put-TemplateDwgPath
                 ;; *********************
                 ;; **  QNew Template  **
                 ;; *********************
                 (vla-put-QNewTemplateFile
                   #Files
                   "s:\\cadd standards\\Template\\CES_Template.dwt"
                 ) ;_ vla-put-QNewTemplateFile
                 ;; *********************
                 ;; **  Support Paths  **
                 ;; *********************
                 (vla-put-supportpath
                   #Files
                   (strcat ";s:\\cadd standards\\startup"
                           ";s:\\cadd standards\\lisp"
                           ";s:\\cadd standards\\linetypes"
                           ";s:\\cadd standards\\fonts"
                           ";s:\\cadd standards\\ces layers"
                           ";"
                           (vla-get-supportpath #Files)
                   ) ;_ strcat
                 ) ;_ vla-put-supportpath
                 ;; ***************************
                 ;; **  Tool Palettes Paths  **
                 ;; ***************************
                 (vla-put-ToolPalettePath
                   #Files
                   (strcat "S:\\CADD Standards\\Toolpalette\\Palettes;"
                           (vla-get-ToolPalettePath #Files)
                   ) ;_ strcat
                 ) ;_ vla-put-ToolPalettePath
               ) ;_ lambda
            ) ;_ vl-catch-all-apply
          ) ;_ vl-catch-all-error-p
        ) ;_ not
        (alert
          (strcat
            "AutoCAD has been setup for Capital Engineering & Surveying, Inc. Standards.\n\n"
            "                      Please restart AutoCAD."
          ) ;_ strcat
        ) ;_ alert
      ) ;_ and
      (princ)
    ) ;_ defun
    (alert "Type: \"CES-SETUP\" to run setup.")
    (princ)

    Alan,

    Maybe I cannot read it well enough but what is the difference between yours and mine? I mean, does yours add the paths?

  6. #6
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,136

    Default

    Quote Originally Posted by MarcoW View Post
    Alan,

    Maybe I cannot read it well enough but what is the difference between yours and mine? I mean, does yours add the paths?
    Yes, it adds the paths. I took the Visual Lisp route as shown in Larry's link. Also, in addition to Support Paths, mine sets many others (eg. ToolPalette, Plotter Config., QNew Template, Template, etc.). Just look at the comment sections.
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  7. #7
    Super Member MarcoW's Avatar
    Computer Details
    MarcoW's Computer Details
    Operating System:
    Microsoft Windows 7 Pro 64-bit
    Computer:
    A black one
    CPU:
    Intel Xeon E5520 Quad Core
    RAM:
    8 GB
    Graphics:
    NVIDIA Quadro FX 580 - 512MB
    Primary Storage:
    300 GB 10000 RPM
    Using
    AutoCAD 2011
    Join Date
    Apr 2009
    Location
    The Netherlands
    Posts
    599

    Default

    Quote Originally Posted by alanjt View Post
    Yes, it adds the paths.
    Okay, that I could not see.

    Quote Originally Posted by alanjt View Post
    I took the Visual Lisp route as shown in Larry's link.
    Since you (and maybe many others) have walked that way, I believe it might be a good way!

    Quote Originally Posted by alanjt View Post
    Also, in addition to Support Paths, mine sets many others (eg. ToolPalette, Plotter Config., QNew Template, Template, etc.). Just look at the comment sections.
    I did read it Alan, and read the comments. Allready played with it, not succesfull but that will work out.

    I have a routine alike yours, but I do not need so many things to set. (I use toolpalettes and SFSP..) My problem is to add... like I said.

    Thank you very much for the response, I can go on for a while now

  8. #8
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,136

    Default

    Quote Originally Posted by MarcoW View Post
    Okay, that I could not see.


    Since you (and maybe many others) have walked that way, I believe it might be a good way!


    I did read it Alan, and read the comments. Allready played with it, not succesfull but that will work out.

    I have a routine alike yours, but I do not need so many things to set. (I use toolpalettes and SFSP..) My problem is to add... like I said.

    Thank you very much for the response, I can go on for a while now
    It won't work if the paths do not exist.

    Even if it's more than you need, it gives you options on adding several others.

    Happy CAD'ing.
    Last edited by alanjt; 26th Apr 2010 at 11:10 pm. Reason: retarded typos
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  9. #9
    Super Member MarcoW's Avatar
    Computer Details
    MarcoW's Computer Details
    Operating System:
    Microsoft Windows 7 Pro 64-bit
    Computer:
    A black one
    CPU:
    Intel Xeon E5520 Quad Core
    RAM:
    8 GB
    Graphics:
    NVIDIA Quadro FX 580 - 512MB
    Primary Storage:
    300 GB 10000 RPM
    Using
    AutoCAD 2011
    Join Date
    Apr 2009
    Location
    The Netherlands
    Posts
    599

    Default

    Quote Originally Posted by alanjt View Post
    It work work if the paths do not exist.
    You mean it only works if the path exist, am I right?
    How come that this does not work:

    Code:
     
    (vla-put-supportpath
                   #Files
            (strcat ";C:\\MarcoW"
                           ";"
                           (vla-get-supportpath #Files)
                   ) ;_ strcat
                 )
    ... while the map "C:\MarcoW" does exist

    Another question, and maybe it has got something to do with it:
    What's up with the ";" in the code (what I made blue above).
    What does that thing do in the code? I ask because in my code it seems to be on the end of the line...

    Thanks for helping me out.

  10. #10
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,136

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by MarcoW View Post
    You mean it only works if the path exist, am I right?
    How come that this does not work:

    Code:
     
    (vla-put-supportpath
                   #Files
            (strcat ";C:\\MarcoW"
                           ";"
                           (vla-get-supportpath #Files)
                   ) ;_ strcat
                 )
    ... while the map "C:\MarcoW" does exist

    Another question, and maybe it has got something to do with it:
    What's up with the ";" in the code (what I made blue above).
    What does that thing do in the code? I ask because in my code it seems to be on the end of the line...

    Thanks for helping me out.
    What you posted works fine on my end. Actually, it added it without having the path created.

    As far as the semicolon goes, it's just to break to the next path (multiple paths). I just put it in the beginning because it just seemed a little cleaner/neater to put it first.

    It's just like using "\n" in a string.

    eg.
    (strcat "\nALAN" "\nThompson") = (strcat "\nALAN\n" "Thompson")
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

Similar Threads

  1. "save" in the file "pull down menu" not working
    By kfarrar in forum Civil 3D & LDD
    Replies: 11
    Last Post: 25th Dec 2013, 10:22 am
  2. Replies: 1
    Last Post: 25th Nov 2009, 06:35 pm
  3. AcadMap3D 2010_freezes on "open" or "save" ...
    By Jest in forum AutoCAD Bugs, Error Messages & Quirks
    Replies: 8
    Last Post: 26th Aug 2009, 08:27 am
  4. Lisp routine to delete a file form "C" drive
    By muck in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 28th Mar 2007, 09:01 pm
  5. "Union" Meshes or "Slice" 3D Mesh
    By Peter31712 in forum AutoCAD 3D Modelling & Rendering
    Replies: 1
    Last Post: 29th Apr 2004, 11:11 pm

Bookmarks

Posting Permissions

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