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

0 Members and 1 Guest are viewing this topic.

Matersammichman

  • Guest
Support File Search Path
« on: July 17, 2006, 09:29:30 AM »
Can vba be used to define a new Support File Search Path?

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Support File Search Path
« Reply #1 on: July 17, 2006, 09:53:11 AM »
Yes, what are you trying to do?
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 #2 on: July 17, 2006, 09:56:34 AM »
This is how I make sure these drives are in the path.
Code: [Select]
Public Sub ACADStartup()
    Set AutoCAD = Application
    Dim strUSER As String
    Dim supppath As String
    supppath = UCase(ThisDrawing.Application.Preferences.Files.SupportPath)
    'This will prevent you entering the same entry more than once
    If InStr(1, supppath, "U:\TITLEBLOCKS") > 1 Then
    GoTo Nextline
    Else
    ThisDrawing.Application.Preferences.Files.SupportPath = supppath & ";" & "U:\TITLEBLOCKS"
    End If
Nextline:
    If InStr(1, supppath, "U:\symbols") > 1 Then
    GoTo Lastline
    Else
    ThisDrawing.Application.Preferences.Files.SupportPath = supppath & ";" & "U:\symbols"
    End If
Lastline:
    If InStr(1, supppath, "U:\PROJECTLOGS") > 1 Then
    Exit Sub
    Else
    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)

Matersammichman

  • Guest
Re: Support File Search Path
« Reply #3 on: July 17, 2006, 10:02:49 AM »
I want to use VBA to insert a dwg, but if it's not in a defined path, vba chokes because it can't find the block, so I need to be able to define the new path.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Support File Search Path
« Reply #4 on: July 17, 2006, 10:12:36 AM »
using the above, you should be able to add your path.  Let me know if you need help
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 #5 on: July 17, 2006, 11:04:34 AM »
Got it working, thanks.

Jeff_M

  • King Gator
  • Posts: 4088
  • C3D user & customizer
Re: Support File Search Path
« Reply #6 on: July 17, 2006, 11:48:14 AM »
Got it working, thanks.
What version are you using? I've seen reports that in 2007 the InsertBlock now requires a fully qualified path name. So just making sure the Support Paths point to your blocks does not work...... :(  Note that I have not personally tested this. (Note to self, test this later today)

Matersammichman

  • Guest
Re: Support File Search Path
« Reply #7 on: July 18, 2006, 07:29:13 AM »
2005 adt

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Support File Search Path
« Reply #8 on: July 18, 2006, 09:45:14 AM »
JM, its uncomfirmed on my end, but I was having problems yesterday with inserting blocks.  Have to look into that today.
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)