Finding the User's Acad Support folder

Discussion in 'AutoCAD' started by D Hartley, May 25, 2004.

  1. D Hartley

    D Hartley Guest

    Is there VBA way to find the path to the location of the User's Acad Support
    Folder

    Thanks much

    David
     
    D Hartley, May 25, 2004
    #1
  2. Run the system variable MYDOCUMENTSPREFIX (autocad 2005)
     
    Humberto Guerrero Obando, May 25, 2004
    #2
  3. D Hartley

    Mike Weaver Guest

    How about:
    thisdrawing.application.path

    HTH,
    Mike Weaver
     
    Mike Weaver, May 25, 2004
    #3
  4. D Hartley

    Ed Jobe Guest

    Sorry Mike, that gives the location of acad.exe, not the Support folder.

    DH, there are more than one support folder. Use the Preferences to find them.

    Application.Preferences.Files.SupportPath

    This returns a semicolon delimited string of all the support folders.

    --
    ----
    Ed
    ----
    "Mike Weaver" <mweaver AT bettisworth DOT com> wrote in message How about:
    thisdrawing.application.path

    HTH,
    Mike Weaver
     
    Ed Jobe, May 25, 2004
    #4
  5. D Hartley

    D Hartley Guest

    I tried this, and it seems to work. I'm trying to write a text file somewhere that makes sense on the user's computer. I'm assuming in this that everyone using AutoCAD has a "Support" folder within the folder that contains acad.exe .

    Is that maybe not a good assumption?


    Dim pathString As String
    pathString = ThisDrawing.Application.path & "\Support\MyFile.txt"
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set a = fs.CreateTextFile(pathString, True)

    Sorry Mike, that gives the location of acad.exe, not the Support folder.

    DH, there are more than one support folder. Use the Preferences to find them.

    Application.Preferences.Files.SupportPath

    This returns a semicolon delimited string of all the support folders.

    --
    ----
    Ed
    ----
    "Mike Weaver" <mweaver AT bettisworth DOT com> wrote in message How about:
    thisdrawing.application.path

    HTH,
    Mike Weaver
     
    D Hartley, May 25, 2004
    #5
  6. D Hartley

    Ed Jobe Guest

    Yes, "...\Support" is a standard acad folder, through 2005.

    --
    ----
    Ed
    ----
    I tried this, and it seems to work. I'm trying to write a text file somewhere that makes sense on the user's computer. I'm assuming in this that everyone using AutoCAD has a "Support" folder within the folder that contains acad.exe .

    Is that maybe not a good assumption?


    Dim pathString As String
    pathString = ThisDrawing.Application.path & "\Support\MyFile.txt"
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set a = fs.CreateTextFile(pathString, True)

    Sorry Mike, that gives the location of acad.exe, not the Support folder.

    DH, there are more than one support folder. Use the Preferences to find them.

    Application.Preferences.Files.SupportPath

    This returns a semicolon delimited string of all the support folders.

    --
    ----
    Ed
    ----
    "Mike Weaver" <mweaver AT bettisworth DOT com> wrote in message How about:
    thisdrawing.application.path

    HTH,
    Mike Weaver
     
    Ed Jobe, May 25, 2004
    #6
  7. D Hartley

    Mike Weaver Guest

    My bad.

    How about this (works in 2005):

    Public Function GetSupportPaths() As Variant
    Dim strPrefsFiles As String

    strPrefsFiles = ThisDrawing.Application.preferences.files
    GetSupportPaths = Split(strPrefsFiles, ";")

    End Function

    returns an array of strings, each item being a support folder

    The support folder under the executable may or may not be in the search path.

    Mike
    Sorry Mike, that gives the location of acad.exe, not the Support folder.

    DH, there are more than one support folder. Use the Preferences to find them.

    Application.Preferences.Files.SupportPath

    This returns a semicolon delimited string of all the support folders.

    --
    ----
    Ed
    ----
    "Mike Weaver" <mweaver AT bettisworth DOT com> wrote in message How about:
    thisdrawing.application.path

    HTH,
    Mike Weaver
     
    Mike Weaver, May 25, 2004
    #7
  8. D Hartley

    Ed Jobe Guest

    Good. A complementary function would be useful too, to rebuild the string after editing/adding folders.

    --
    ----
    Ed
    ----
    "Mike Weaver" <mweaver AT bettisworth DOT com> wrote in message My bad.

    How about this (works in 2005):

    Public Function GetSupportPaths() As Variant
    Dim strPrefsFiles As String

    strPrefsFiles = ThisDrawing.Application.preferences.files
    GetSupportPaths = Split(strPrefsFiles, ";")

    End Function

    returns an array of strings, each item being a support folder

    The support folder under the executable may or may not be in the search path.

    Mike
    Sorry Mike, that gives the location of acad.exe, not the Support folder.

    DH, there are more than one support folder. Use the Preferences to find them.

    Application.Preferences.Files.SupportPath

    This returns a semicolon delimited string of all the support folders.

    --
    ----
    Ed
    ----
    "Mike Weaver" <mweaver AT bettisworth DOT com> wrote in message How about:
    thisdrawing.application.path

    HTH,
    Mike Weaver
     
    Ed Jobe, May 25, 2004
    #8
  9. There is no formal 'support' folder, there is a
    support path that can include any number of folders.

    In AutoCAD 2004/2005, this will give you the root
    folder where user-specific support files can be
    placed:

    (getvar "ROAMABLEROOTPREFIX")





    I tried this, and it seems to work. I'm trying to write a text file somewhere that makes sense on the user's computer.
    I'm assuming in this that everyone using AutoCAD has a "Support" folder within the folder that contains acad.exe .

    Is that maybe not a good assumption?


    Dim pathString As String
    pathString = ThisDrawing.Application.path & "\Support\MyFile.txt"
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set a = fs.CreateTextFile(pathString, True)

    Sorry Mike, that gives the location of acad.exe, not the Support folder.

    DH, there are more than one support folder. Use the Preferences to find them.

    Application.Preferences.Files.SupportPath

    This returns a semicolon delimited string of all the support folders.

    --
    ----
    Ed
    ----
    "Mike Weaver" <mweaver AT bettisworth DOT com> wrote in message How about:
    thisdrawing.application.path

    HTH,
    Mike Weaver
     
    Tony Tanzillo, May 26, 2004
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.