+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
  1. #1
    Forum Newbie
    Using
    AutoCAD 2012
    Join Date
    Mar 2012
    Posts
    2

    Default Adding Folders to Support File Search Path

    Registered forum members do not see this ad.

    Hi all,
    I am looking at a way to automatically add folders to the support file search path. I used to use AcadInstall.exe but it is no longer supported for later versions of AutoCAD. Does anyone know where the Support File Search Path is located in the windows registry. I thouhgt I could write a program to add to the registry key.

    On a similar idea, is it also possible to write to the registry .vlx files to the startup menu. If so where is it located in the registry and does anyone know a good way to add to the registry? Thanks

    P.S I know I can automatically run a lisp routine to do this stuff inside AutoCAD but want to run a .exe or .bat file at the end of an installation program.

  2. #2
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,815

    Default

    It can be done directly add or remove

    Code:
    ; This sets a reference to the install path of your product
    ; the gets are their for info maybe other use
    (vl-load-com)
    ; make temp directory
    ;(vl-mkdir "c:\\ACADTEMP")
    (setq *files*  (vla-get-files  (vla-get-preferences (vlax-get-acad-object))))
    ; savepath
    ;(vla-get-AutoSavepath *files*)
    (vla-put-AutoSavepath *files* "C:\\ACADTemp")
    ; custom icons
    ;(vla-get-CustomIconPath *files*))
    (vla-put-CustomIconPath *files* "P:\\Autodesk\\ICONS")
    ; printers config
    ;(vla-get-PrinterConfigPath *files*)
    (vla-put-PrinterConfigPath *files* "P:\\AutoDESK\\Plotting\\Plot Styles 2011")
    ; printers style sheet
    ;(vla-get-PrinterStyleSheetPath *files*)
    (vla-put-PrinterStyleSheetPath *files* "P:\\AutoDESK\\Plotting\\Plot Styles")
    ; printer drv's
    ;(vla-get-PrinterDescPath *files*)
    (vla-put-PrinterDescPath *files* "P:\\AutoDESK\\Plotting\\Drv")
    ; print spooler
    ;(vla-get-PrintSpoolerPath *files*)
    (vla-put-PrintSpoolerPath *files* "C:\\ACADTemp\\")
    ; template location
    ;(vla-get-QnewTemplateFile *files*)
    (vla-put-QnewTemplateFile *files* "P:\\Autodesk\\c3d Templates\\cogg.dwt")
    ;make new support paths exist + new
    (setq paths (vla-get-SupportPath *files*))
     
     (setq newpaths 
      "P:\\autodesk\\supportfiles;
      P:\\autodesk\\lisp;
      P:\\autodesk\\fonts;
      P:\\autodesk\\hfs fonts;"
      )
    (setq newpath (strcat newpaths paths))
    (vla-put-SupportPath *files* newpath)
    ; Tempdirectory 
    ;(vla-get-TempFilePath *files*))
    (vla-put-TempFilePath *files* "C:\\ACADTemp\\")
    ; template  path
    ;(vla-get-TemplateDwgPath *files*)
    (vla-put-TemplateDwgPath *files* "P:\\Autodesk\\c3d Templates")
    ; xref temp path
    ;(vla-get-TempXrefPath *files*))
    (vla-put-TempXrefPath *files* "C:\\ACADTemp\\")
    ; end use of *files*
    (vlax-release-object *files*)
    ; exit quitely
    (princ "All Done")
    All most forgot you can use profiles and have different icons on your desktop to to run different menus and setups. You basicly need two things a ARG & a Cui they live together. Just use the lisp above to set the path structure and save a ARG the one missing is the main custom menu I will try to find variable.
    A man who never made mistakes never made anything

  3. #3
    Full Member Keywordkid's Avatar
    Computer Details
    Keywordkid's Computer Details
    Operating System:
    Win 7
    Discipline
    Architectural
    Keywordkid's Discipline Details
    Occupation
    CAD Manager
    Discipline
    Architectural
    Using
    AutoCAD 2012
    Join Date
    Jun 2012
    Location
    London, UK
    Posts
    86

    Default

    I may be mistaken as I'm pretty new to AutoCAD lisping but the registry entry for the main cuix is
    MenuFile
    hope this helps.

  4. #4
    Full Member Keywordkid's Avatar
    Computer Details
    Keywordkid's Computer Details
    Operating System:
    Win 7
    Discipline
    Architectural
    Keywordkid's Discipline Details
    Occupation
    CAD Manager
    Discipline
    Architectural
    Using
    AutoCAD 2012
    Join Date
    Jun 2012
    Location
    London, UK
    Posts
    86

    Default

    Quote Originally Posted by BIGAL View Post
    It can be done directly add or remove

    Code:
    ; This sets a reference to the install path of your product
    ; the gets are their for info maybe other use
    (vl-load-com)
    ; make temp directory
    ;(vl-mkdir "c:\\ACADTEMP")
    (setq *files*  (vla-get-files  (vla-get-preferences (vlax-get-acad-object))))
    ; savepath
    ;(vla-get-AutoSavepath *files*)
    (vla-put-AutoSavepath *files* "C:\\ACADTemp")
    ; custom icons
    ;(vla-get-CustomIconPath *files*))
    (vla-put-CustomIconPath *files* "P:\\Autodesk\\ICONS")
    ; printers config
    ;(vla-get-PrinterConfigPath *files*)
    (vla-put-PrinterConfigPath *files* "P:\\AutoDESK\\Plotting\\Plot Styles 2011")
    ; printers style sheet
    ;(vla-get-PrinterStyleSheetPath *files*)
    (vla-put-PrinterStyleSheetPath *files* "P:\\AutoDESK\\Plotting\\Plot Styles")
    ; printer drv's
    ;(vla-get-PrinterDescPath *files*)
    (vla-put-PrinterDescPath *files* "P:\\AutoDESK\\Plotting\\Drv")
    ; print spooler
    ;(vla-get-PrintSpoolerPath *files*)
    (vla-put-PrintSpoolerPath *files* "C:\\ACADTemp\\")
    ; template location
    ;(vla-get-QnewTemplateFile *files*)
    (vla-put-QnewTemplateFile *files* "P:\\Autodesk\\c3d Templates\\cogg.dwt")
    ;make new support paths exist + new
    (setq paths (vla-get-SupportPath *files*))
     
     (setq newpaths 
      "P:\\autodesk\\supportfiles;
      P:\\autodesk\\lisp;
      P:\\autodesk\\fonts;
      P:\\autodesk\\hfs fonts;"
      )
    (setq newpath (strcat newpaths paths))
    (vla-put-SupportPath *files* newpath)
    ; Tempdirectory 
    ;(vla-get-TempFilePath *files*))
    (vla-put-TempFilePath *files* "C:\\ACADTemp\\")
    ; template  path
    ;(vla-get-TemplateDwgPath *files*)
    (vla-put-TemplateDwgPath *files* "P:\\Autodesk\\c3d Templates")
    ; xref temp path
    ;(vla-get-TempXrefPath *files*))
    (vla-put-TempXrefPath *files* "C:\\ACADTemp\\")
    ; end use of *files*
    (vlax-release-object *files*)
    ; exit quitely
    (princ "All Done")
    All most forgot you can use profiles and have different icons on your desktop to to run different menus and setups. You basicly need two things a ARG & a Cui they live together. Just use the lisp above to set the path structure and save a ARG the one missing is the main custom menu I will try to find variable.
    BIGAL, using a combination of your information and some other advice on using the ACAD.lsp and ACADDOC.lsp I have got the support paths working as desired for my company standards, the problem I have now is these are also loading for my client configs. Cilents are fired from a /p shortcut switch to a different network location which loads the client arg.

    I'm assuming this has something to do with local registry settings as most of the issues I encounter seem to end up that way.

    Am I missing something here to keep seperate configs from being ignored?

    Here is my company standards ACAD.lsp
    Code:
    ; Set registry file search paths
    (setenv "SaveFilePath" (strcat "C:\\ACAD\\"(getvar "loginname")))
    (setenv "LogFilePath" (strcat "C:\\ACAD\\"(getvar "loginname")))
    (setenv "ActRecPath" (strcat "C:\\ACAD\\"(getvar "loginname")))
    (setenv "ActRecPath" (strcat "C:\\ACAD\\"(getvar "loginname")))
    (setenv "PlotLogPath" (strcat "C:\\ACAD\\"(getvar "loginname")))
    (setenv "ACADDRV" (strcat "C:\\Program Files\\Autodesk\\AutoCAD 2012 - English\\drv"))
    (setenv "EnterpriseMenuFile" (strcat "c:\\acad\\ACAD-2012-LOCAL\\support\\SWD-Default.cuix"))
    (setenv "QnewTemplate" (strcat "c:\\acad\\ACAD-2012-LOCAL\\template\\SWD2012.dwt"))
    (princ)
    (vl-load-com)
    ; This sets a reference to the files portion of the acad preferences
    (setq *files* (vla-get-files
       (vla-get-preferences (vlax-get-acad-object))
    ))
    ; This builds the string of support file search paths
    (setq sfsp
           (strcat
    "C:\\ACAD\\"(getvar "loginname")"\\support;"
    "C:\\ACAD\\ACAD-2012-LOCAL\\03-Fonts;"
    "C:\\ACAD\\ACAD-2012-LOCAL\\04-CTB-Files;"
    "C:\\ACAD\\ACAD-2012-LOCAL\\05-AutoCAD Pattern Files;"
    "C:\\ACAD\\ACAD-2012-LOCAL\\support;"
    "C:\\ACAD\\ACAD-2012-LOCAL\\support\\color;"
     )
    )
    ; This actually applies the above string to the current session of AutoCAD.
    (vla-put-SupportPath *files* sfsp)
    ; Release the object
    (vlax-release-object *files*)
     
    (command "Menu" (strcat "c:\\acad\\"(getvar "loginname")"\\support\\mymenu.cuix"))
     
    (princ)
    And the only relevant item in my ACADDOC is
    Code:
    ;Load this just once
    (SETVAR "acadlspdoc" 0)

  5. #5
    Luminous Being BlackBox's Avatar
    Computer Details
    BlackBox's Computer Details
    Operating System:
    Windows 8.1 Professional, Server 2012 R2 Datacenter
    Computer:
    Dell Precision T3600
    CPU:
    Hex-Core Intel Xeon 3.2Ghz
    RAM:
    32GB
    Graphics:
    3GB NVIDIA Quadro K4000
    Primary Storage:
    2 x 240GB Samsung EVO SSD (RAID 0)
    Secondary Storage:
    1TB Western Digital VelociRaptor 10K RPM
    Monitor:
    Dual 24" Dell Ultrasharp Widescreen Monitors
    Discipline
    Civil
    BlackBox's Discipline Details
    Occupation
    Senior Civil Designer
    Discipline
    Civil
    Details
    Public/Private Land Development, Transportation, and Utilities.
    Using
    Civil 3D 2016
    Join Date
    Nov 2009
    Posts
    5,282

    Default

    Perhaps this is a bit nit-picky of me, but you do not need to use STRCAT unless combining strings.

    Quote Originally Posted by Keywordkid View Post

    Here is my company standards ACAD.lsp
    Code:
    ; Set registry file search paths
    (setenv "SaveFilePath" (strcat "C:\\ACAD\\"(getvar "loginname")))
    (setenv "LogFilePath" (strcat "C:\\ACAD\\"(getvar "loginname")))
    (setenv "ActRecPath" (strcat "C:\\ACAD\\"(getvar "loginname")))
    (setenv "ActRecPath" (strcat "C:\\ACAD\\"(getvar "loginname")))
    (setenv "PlotLogPath" (strcat "C:\\ACAD\\"(getvar "loginname")))
    (setenv "ACADDRV" (strcat "C:\\Program Files\\Autodesk\\AutoCAD 2012 - English\\drv"))
    (setenv "EnterpriseMenuFile" (strcat "c:\\acad\\ACAD-2012-LOCAL\\support\\SWD-Default.cuix"))
    (setenv "QnewTemplate" (strcat "c:\\acad\\ACAD-2012-LOCAL\\template\\SWD2012.dwt"))
    (princ)
    
    ;; <snip>

    Also...

    Code:
    (defun c:SFSP+  (/ *error*)
      (vl-load-com)
    
      (defun *error*  (msg)
        (if oShell
          (setq oShell (vlax-release-object oShell)))
        (cond ((not msg))                                                   ; Normal exit
              ((member msg '("Function cancelled" "quit / exit abort")))    ; <esc> or (quit)
              ((princ (strcat "\n** Error: " msg " ** "))))                 ; Fatal error, display it
        (princ))
    
      ((lambda (acApp / oShell oFolder acDoc acFiles path oldPath)
         (if
           (and
             (setq oShell
                    (vlax-get-or-create-object "Shell.Application"))
             (setq oFolder
                    (vlax-invoke
                      oShell
                      'BrowseForFolder
                      (vla-get-hwnd acApp)
                      "Select a folder to add to SFSP:"
                      0
                      17)))
            (if
              (not
                (vl-string-search
                  (strcase
                    (setq path
                           (strcat
                             (vlax-get-property
                               (vlax-get-property oFolder 'Self)
                               'Path)
                             ";")))
                  (strcase
                    (setq oldPath
                           (strcat
                             (vl-string-right-trim
                               ";"
                               (vla-get-supportpath
                                 (setq acFiles
                                        (vla-get-files
                                          (vla-get-preferences
                                            acApp)))))
                             ";")))))
    
               (progn
                 (vla-put-supportpath acFiles (strcat oldPath ";" path))
                 (*error* nil))
               (*error* "Path already exists in SFSP"))
            (cond
              (oShell (*error* nil))
              ((*error* "Unable to create Shell.Application Object")))))
        (vlax-get-acad-object)))
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD, and Civil 3D Certified Professional | Autodesk Authorized Developer
    Sincpac C3D ~ Exchange Apps ~ Autoloader ~ AutoCAD Security

  6. #6
    Full Member Keywordkid's Avatar
    Computer Details
    Keywordkid's Computer Details
    Operating System:
    Win 7
    Discipline
    Architectural
    Keywordkid's Discipline Details
    Occupation
    CAD Manager
    Discipline
    Architectural
    Using
    AutoCAD 2012
    Join Date
    Jun 2012
    Location
    London, UK
    Posts
    86

    Default

    Hi RenderMan,

    Can you elborate on the functions of your second code example, as you identified with the unnecessary code I'd added in my posting I'm quite a newbie to AutoCAD coding, I have more experience in VBA for MicroStation, so descriptions are a really useful learning aid as I develop.

    Thanks.

  7. #7
    Luminous Being BlackBox's Avatar
    Computer Details
    BlackBox's Computer Details
    Operating System:
    Windows 8.1 Professional, Server 2012 R2 Datacenter
    Computer:
    Dell Precision T3600
    CPU:
    Hex-Core Intel Xeon 3.2Ghz
    RAM:
    32GB
    Graphics:
    3GB NVIDIA Quadro K4000
    Primary Storage:
    2 x 240GB Samsung EVO SSD (RAID 0)
    Secondary Storage:
    1TB Western Digital VelociRaptor 10K RPM
    Monitor:
    Dual 24" Dell Ultrasharp Widescreen Monitors
    Discipline
    Civil
    BlackBox's Discipline Details
    Occupation
    Senior Civil Designer
    Discipline
    Civil
    Details
    Public/Private Land Development, Transportation, and Utilities.
    Using
    Civil 3D 2016
    Join Date
    Nov 2009
    Posts
    5,282

    Default

    Quote Originally Posted by Keywordkid View Post

    Can you elborate on the functions of your second code example, as you identified with the unnecessary code I'd added in my posting I'm quite a newbie to AutoCAD coding, I have more experience in VBA for MicroStation, so descriptions are a really useful learning aid as I develop.
    No worries; we all start somewhere... Welcome to the world of AutoCAD development!

    The Support Files Search Path Plus (SFSP+) function I posted uses an IF statement with a test expression which prompts the user to select a Folder Object via the Shell.Application Object's BrowseForFolder Method.

    Upon a valid Folder Object being identified, the Path Property is extracted from the Folder Objects's Self Property Object.

    This Path Property is then searched for against the PreferencesFiles Object's SupportPath Property (as String).

    If the SupportPath Property (as String) does not contain the new Path selected, then the new Path is added to the end of the SupportPath Property String, and the SupportPath Property is replaced.

    Hope this helps! (HTH)
    Last edited by BlackBox; 29th Jun 2012 at 01:26 pm.
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD, and Civil 3D Certified Professional | Autodesk Authorized Developer
    Sincpac C3D ~ Exchange Apps ~ Autoloader ~ AutoCAD Security

  8. #8
    Forum Newbie
    Using
    Architecture 2014
    Join Date
    Jun 2014
    Posts
    1

    Default SFSP+ lisp

    Hi Blackbox,


    The lisp "SFSP+" looks great, however, each folder can be only added individually.
    Can you modify the lisp in a way that allows you select a folder and its all subfolders. This means the lisp routine be able to add all the subfolders to "support files search path" automatically.


    Thanks

  9. #9
    Junior Member
    Computer Details
    sathalex's Computer Details
    Operating System:
    Windows
    Computer:
    Asus
    Using
    AutoCAD 2015
    Join Date
    Jul 2016
    Location
    Russia
    Posts
    15

    Default

    Hello. Tell me please, how to adding folder to support file search path at first level in list AutoCAD? I saw this code on this forum. But now I can not find him.
    Thanks to everyone who will help )

  10. #10
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,815

    Default

    Registered forum members do not see this ad.

    Try the method in the code above the order by using the strcat put your path 1st then add the existing.

    Code:
    (setq newpath (strcat newpaths paths))
    Last edited by BIGAL; 10th Aug 2017 at 10:38 am.
    A man who never made mistakes never made anything

Similar Threads

  1. Support file search path
    By mdbdesign in forum AutoCAD General
    Replies: 6
    Last Post: 8th Oct 2009, 02:14 pm
  2. AutoCAD's Support File Search Path
    By CAD Panacea in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 4th Sep 2009, 05:50 am
  3. Support File Search Path
    By mcguirepm in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 23rd Jan 2009, 06:11 pm
  4. Support File Search Path via VBA
    By ZenCad1960 in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 5th Nov 2008, 03:10 pm
  5. Support File Search Path
    By christ0j in forum AutoCAD Drawing Management & Output
    Replies: 7
    Last Post: 3rd Feb 2006, 06:34 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