+ Reply to Thread
Results 1 to 7 of 7
  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
    Forum Deity
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    3,780

    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
    67

    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
    67

    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
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,932

    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

  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
    67

    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
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,932

    Default

    Registered forum members do not see this ad.

    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

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