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

0 Members and 1 Guest are viewing this topic.

deegeecees

  • Guest
Re: Support File Search Path
« Reply #15 on: October 25, 2006, 01:34:47 PM »
Oooooops, too slooooowwww....

Matersammichman

  • Guest
Re: Support File Search Path
« Reply #16 on: October 25, 2006, 01:36:18 PM »
Yes, it saves "Support paths", but NOT "WORKING file support paths". They appear to be linked into the Support Paths, but non-editable directly.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Support File Search Path
« Reply #17 on: October 25, 2006, 01:36:44 PM »
nah, I just copy paste faster than you.  BTW, did you get yous working?
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 #18 on: October 25, 2006, 01:37:30 PM »
Working paths are what you get after you hit apply and Acad resolves whether you put in valid paths
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)

Matersammichman

  • Guest
Re: Support File Search Path
« Reply #19 on: October 25, 2006, 01:40:01 PM »
Correct.
Unfortunately, when I deleted\overwrote the "Support" paths, it did not update the "Working" paths.

deegeecees

  • Guest
Re: Support File Search Path
« Reply #20 on: October 25, 2006, 01:42:38 PM »
nah, I just copy paste faster than you.  BTW, did you get yous working?

"Swamped" at the moment. Barely have time to type this. Its on the back burner for now. Just not enough time in the day some times, lunchtime is the only time I have to myself.

Matersammichman

  • Guest
Re: Support File Search Path
« Reply #21 on: October 25, 2006, 02:10:25 PM »
'''Thanks guys, I was using that code to start with yesterday, but there's still a problem. Here is the exact code I am using:

Dim supppath3 As String
    supppath3 =
UCase(ThisDrawing.Application.Preferences.Files.SupportPath)
    If Not (InStr(1, supppath3, "G:\Arc\CAD System\Template") > 1) Then
        ThisDrawing.Application.Preferences.Files.SupportPath =
supppath3 & ";" & "G:\Arc\CAD System\Template"
    End If
    Exit Sub

'''what happens is that it will put it in the Support path once as UCase, and once as LCase. Why???

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Support File Search Path
« Reply #22 on: October 25, 2006, 02:27:01 PM »
Duplications due to case and slash characters is why I have entries like this in my lisp library --

Code: [Select]
(defun _Replace ( oldText newText text / i )
    (if (/= oldText newText)
        (while (setq i (vl-string-search oldText text))
            (setq text
                (vl-string-subst
                    newText
                    oldText
                    text
                    i
                )
            )
        )
    )
    text
)

And then this --

Code: [Select]
(defun _AddStr ( str1 str2 delim )

    ;;  add str2 to the end of str1 if str2 doesn't exist in str1 (case
    ;;  and slash insensitive) -- put delim between str1 and str2

    (   (lambda ( string pattern )
            (if
                (null
                    (or
                        (wcmatch string pattern)
                        (wcmatch string (strcat pattern delim "*"))
                        (wcmatch string (strcat "*" delim pattern delim "*"))
                        (wcmatch string (strcat "*" delim pattern))
                    )
                )
                (strcat str1 delim str2)
                str1
            )   
        )
        (strcase (_Replace "/" "\\" str2))       
        (strcase (_Replace "/" "\\" str1))       
    )   
)

Feel free to convert to equivalent VB code. I'd do it but (1) headache (2) too sleepy, even though it's admittedly a trivial task.

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Support File Search Path
« Reply #23 on: October 25, 2006, 02:33:20 PM »
It is put in in lower case the first time, then the second time through, It converts it to upper case, and when the check is run to see if its there, it doesn't find it (I know its there, but upper and lower are treated as different cases)

The way to fix your problem is when you add the path, use all upper case
Code: [Select]
  supppath3 =
UCase(ThisDrawing.Application.Preferences.Files.SupportPath)
    If Not (InStr(1, supppath3, "G:\Arc\CAD System\Template") > 1) Then
        ThisDrawing.Application.Preferences.Files.SupportPath =
supppath3 & ";" & "G:\ARC\CAD SYSTEM\TEMPLATE"  ' ADDED THIS LINE
« Last Edit: October 25, 2006, 02:35:34 PM by CmdrDuh »
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)

Matersammichman

  • Guest
Re: Support File Search Path
« Reply #24 on: October 25, 2006, 02:33:51 PM »
Actually, I really appreciate all the help.
I just resolved my own dilemma. WooHoo!!!

Here's the deal:
For whatever reason, vba writes into the Support paths (and all the others as well) all in CAPS. If your code is written in anything else (mixed, or lower case), you will get two entries in your paths: One in whatever case your code is written in, and one in all caps.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Support File Search Path
« Reply #25 on: October 25, 2006, 02:34:55 PM »
See my above post
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)

Matersammichman

  • Guest
Re: Support File Search Path
« Reply #26 on: October 25, 2006, 02:36:10 PM »
I think we were typing at the same time.
Thanks again swampers!