comcu Posted October 29, 2007 Posted October 29, 2007 Is there a way to set up the file support paths so the the path you put in is not to the last folder where the block is? basically i have 20 folders in a folder called cad blocks an example of the path would be p\company name\drawing office\design\tool palettes\cad blocks\structure p\company name\drawing office\design\tool palettes\cad blocks\Fixings - Teks p\company name\drawing office\design\tool palettes\cad blocks\Fixings - Scws p\company name\drawing office\design\tool palettes\cad blocks\Silicone Seals etc etc etc etc Is there a way of just making one path eg p\company name\drawing office\design\tool palettes\cad blocks then autocad will search thru the remaining folders for the blocks? many thanks, Colin Quote
lpseifert Posted October 29, 2007 Posted October 29, 2007 I think you're SOL Colin; AFIK Autocad's support paths must be explicit, it won't search sub-directories. Quote
SLW210 Posted October 29, 2007 Posted October 29, 2007 Easiest solution would be to put all your blocks in the Cad Blocks folder and forget the Sub folders. Quote
VovKa Posted October 29, 2007 Posted October 29, 2007 still, you can automate you work (vl-load-com) (defun Test (Path / SupportPath FilesObj) (setq FilesObj (vla-get-Files (vla-get-Preferences (vlax-get-acad-object)))) (setq SupportPath (strcat (vla-get-SupportPath FilesObj) ";")) (foreach Folder (vl-remove-if-not 'vl-file-directory-p (mapcar (function (lambda (f) (strcat Path "\\" f))) (cddr (vl-directory-files Path)) ) ) (if (not (vl-string-search (strcat Folder ";") SupportPath)) (setq SupportPath (strcat SupportPath (strcat Folder ";"))) ) ) (vla-put-SupportPath FilesObj SupportPath) (vlax-release-object FilesObj) (princ) ) (test "P:\\company name\\drawing office\\design\\tool palettes\\cad blocks") testing needed! Quote
BIGAL Posted October 30, 2007 Posted October 30, 2007 I made a mnu containing all the blocks then can just pick off the screen and path is hard coded so not problem includes a slide image of ech block for easy picking. [TRENCH] [COGGSLD(SD101,KERB)]^C^C(openblk "S:/ACADSTDS/CIVIL STANDARDS/CGG101") There is more code required Quote
ssg Posted October 30, 2007 Posted October 30, 2007 still, you can automate you work (vl-load-com) (defun Test (Path / SupportPath FilesObj) (setq FilesObj (vla-get-Files (vla-get-Preferences (vlax-get-acad-object)))) (setq SupportPath (strcat (vla-get-SupportPath FilesObj) ";")) (foreach Folder (vl-remove-if-not 'vl-file-directory-p (mapcar (function (lambda (f) (strcat Path "\\" f))) (cddr (vl-directory-files Path)) ) ) (if (not (vl-string-search (strcat Folder ";") SupportPath)) (setq SupportPath (strcat SupportPath (strcat Folder ";"))) ) ) (vla-put-SupportPath FilesObj SupportPath) (vlax-release-object FilesObj) (princ) ) (test "P:\\company name\\drawing office\\design\\tool palettes\\cad blocks") testing needed! VovKa seems to be well about vla-xxxx functions! That are effective for many cases. But I've got a simple routine with same result: ;;;Add Full Search Path for all sub directories in s (defun add_fsp(s / dL x) (setq dL (vl-remove "." (vl-remove ".." (vl-directory-files s "*.*" -1)))) (foreach x dL (setenv "ACAD" (strcat (getenv "ACAD") ";" s "\\" x))) ) Quote
VovKa Posted October 30, 2007 Posted October 30, 2007 nice ssg i didn't suspect Acad is smart enough to check whether a given support path already exists Quote
alrob Posted May 29, 2009 Posted May 29, 2009 I'm not a programmer, just a user, are you able to walk me through the process a little bit more. Also, I am using version '08 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.