TheSwamp
Code Red => VB(A) => Topic started by: Matersammichman on July 17, 2006, 09:29:30 AM
-
Can vba be used to define a new Support File Search Path?
-
Yes, what are you trying to do?
-
This is how I make sure these drives are in the path.
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
-
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.
-
using the above, you should be able to add your path. Let me know if you need help
-
Got it working, thanks.
-
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)
-
2005 adt
-
JM, its uncomfirmed on my end, but I was having problems yesterday with inserting blocks. Have to look into that today.