ZenCad1960 Posted November 4, 2008 Posted November 4, 2008 What I am attempting is that when a user opens a session of AutoCAD, the "Project.dvb" fires up and runs a Sub which sets all the Support File Search Paths in which we want to set. I have been able to get it to set one but since I am no VBA Guru, I thought I would ask you guys for some help. The following is the line I have used which adds the 1 path: ThisDrawing.Application.Preferences.Files.SupportPath = "V:\AutoCAD\ABC Standards\Scripts" However all this does is replace ALL of the search paths with this one. I need to know how to add to the current list. On second thought how about check first to see if the path is already there. If not, then add it, if so go to the next one. I expect at least three to 12 new paths depending on how other things work out. Thanks in advance for all your help with this! Zen p.s. I can get the "Project.dvb" to fire up when AutoCAD starts, I just cannot get the path addition code to work... Quote
CmdrDuh Posted November 5, 2008 Posted November 5, 2008 This is what I use Dim supppath As String supppath = UCase(ThisDrawing.Application.Preferences.Files.SupportPath) If Not InStr(1, supppath, "U:\TITLEBLOCKS") > 0 Then ThisDrawing.Application.Preferences.Files.SupportPath = "U:\TITLEBLOCKS" & ";" & supppath End If If Not InStr(1, supppath, "U:\SYMBOLS") > 0 Then ThisDrawing.Application.Preferences.Files.SupportPath = "U:\symbols" & ";" & supppath End If Quote
CmdrDuh Posted November 5, 2008 Posted November 5, 2008 1-grab your existing paths an save as a string variable 2-using InStr() check to see if what you want is in your path, and if Not, insert it Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.