Author Topic: Support File Search Path  (Read 7286 times)

0 Members and 1 Guest are viewing this topic.

Matersammichman

  • Guest
Support File Search Path
« on: October 25, 2006, 10:52:57 AM »
Looking for code to add a path to my Support File Search Path (without deleting or overwriting existing paths), AND update the info in the Working Support File Search Path. :-P

I tried it yesterday. I accidentally deleted my existing paths...that takes a little while to recover from. Geez! Where the heck is that data saved- In the Registry??? :lol:

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Support File Search Path
« Reply #1 on: October 25, 2006, 11:20:40 AM »
Programmer's responsibility to ensure they provide qualified paths; don't duplicate paths etc.

Code: [Select]
(defun _AddSupportPath ( path / files )
    (vla-put-supportpath
        (setq files
            (vla-get-files
                (vla-get-preferences
                    (vlax-get-acad-object)
                )
            )
        )
        (strcat
            (vla-get-supportpath files) ";"
            path
        )   
    )
)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Matersammichman

  • Guest
Re: Support File Search Path
« Reply #2 on: October 25, 2006, 11:26:12 AM »
MP....Ummm...not sure I understand your comments, and
...oooops!!!
I meant to specifically state, I would really like the code to be in vba.
(not that I'm being picky or anything)

Guest

  • Guest
Re: Support File Search Path
« Reply #3 on: October 25, 2006, 11:32:51 AM »
Quote
I meant to specifically state, I would really like the code to be in vba.
Wasn't there sumpin' just the other day regarding this??  Had to do with changing settings using an EXE??  If I find it, I'll post the link.

Quote
(not that I'm being picky or anything)
You sure are!   :-D

Greg B

  • Seagull
  • Posts: 12417
  • Tell me a Joke!
Re: Support File Search Path
« Reply #4 on: October 25, 2006, 11:36:19 AM »
Quote
(not that I'm being picky or anything)
You sure are!   :-D

No he isn't...he did post it in the VB(A) forum.   :police:

Guest

  • Guest
Re: Support File Search Path
« Reply #5 on: October 25, 2006, 11:42:28 AM »
Here's the link: http://www.theswamp.org/index.php?topic=13146.0

Maybe this'll get you going in the right direction.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Support File Search Path
« Reply #6 on: October 25, 2006, 12:10:24 PM »
MP....Ummm...not sure I understand your comments, and
...oooops!!!
I meant to specifically state, I would really like the code to be in vba.
(not that I'm being picky or anything)

Sorry: My bad, not fully awake. :(
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

deegeecees

  • Guest
Re: Support File Search Path
« Reply #7 on: October 25, 2006, 01:21:41 PM »
I tried it yesterday. I accidentally deleted my existing paths...that takes a little while to recover from. Geez! Where the heck is that data saved- In the Registry??? :lol:

Save a Profile.

Matersammichman

  • Guest
Re: Support File Search Path
« Reply #8 on: October 25, 2006, 01:23:01 PM »
I did.
It's not saved there.

deegeecees

  • Guest
Re: Support File Search Path
« Reply #9 on: October 25, 2006, 01:30:34 PM »
Hmmm... Interesting. What version Acad?

Matersammichman

  • Guest
Re: Support File Search Path
« Reply #10 on: October 25, 2006, 01:32:04 PM »
ADT2005 w/SP2

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Support File Search Path
« Reply #11 on: October 25, 2006, 01:32:26 PM »
Its saved in a profile if you export your profile.  What you need to do is set a varible and append to it.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Support File Search Path
« Reply #12 on: October 25, 2006, 01:32:47 PM »
here is code to do what you want
Code: [Select]
Public Sub ACADStartup()
    Dim supppath As String
    supppath = UCase(ThisDrawing.Application.Preferences.Files.SupportPath)

    'This will prevent you entering the same entry more than once
    If Not (InStr(1, supppath, "U:\TITLEBLOCKS") > 1) Then
        ThisDrawing.Application.Preferences.Files.SupportPath = supppath & ";" & "U:\TITLEBLOCKS"
    End If

    supppath = UCase(ThisDrawing.Application.Preferences.Files.SupportPath)
    If Not (InStr(1, supppath, "U:\SYMBOLS") > 1) Then
        ThisDrawing.Application.Preferences.Files.SupportPath = supppath & ";" & "U:\SYMBOLS"
    End If

    supppath = UCase(ThisDrawing.Application.Preferences.Files.SupportPath)
    If Not (InStr(1, supppath, "U:\PROJECTLOGS") > 1) Then
        ThisDrawing.Application.Preferences.Files.SupportPath = supppath & ";" & "U:\PROJECTLOGS"
    End If
    Exit Sub
End Sub
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Support File Search Path
« Reply #13 on: October 25, 2006, 01:33:58 PM »
I set supppath = the support path, then append by using
supppath & ";" & "path im adding"
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

deegeecees

  • Guest
Re: Support File Search Path
« Reply #14 on: October 25, 2006, 01:34:18 PM »
Well, *head scratch* I'm lost there, my profiles in 2002 save support paths.

But, I just got this from CmdrDuh:

Code: [Select]
Public Sub ACADStartup()
    Dim supppath As String
    supppath = UCase(ThisDrawing.Application.Preferences.Files.SupportPath)

    'This will prevent you entering the same entry more than once
    If Not (InStr(1, supppath, "U:\TITLEBLOCKS") > 1) Then
        ThisDrawing.Application.Preferences.Files.SupportPath = supppath & ";" & "U:\TITLEBLOCKS"
    End If

    supppath = UCase(ThisDrawing.Application.Preferences.Files.SupportPath)
    If Not (InStr(1, supppath, "U:\SYMBOLS") > 1) Then
        ThisDrawing.Application.Preferences.Files.SupportPath = supppath & ";" & "U:\SYMBOLS"
    End If

    supppath = UCase(ThisDrawing.Application.Preferences.Files.SupportPath)
    If Not (InStr(1, supppath, "U:\PROJECTLOGS") > 1) Then
        ThisDrawing.Application.Preferences.Files.SupportPath = supppath & ";" & "U:\PROJECTLOGS"
    End If
    Exit Sub
End Sub