Jump to content

Recommended Posts

Posted

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

Posted

I think you're SOL Colin; AFIK Autocad's support paths must be explicit, it won't search sub-directories.

Posted

Easiest solution would be to put all your blocks in the Cad Blocks folder and forget the Sub folders.

Posted

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!

Posted

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

Posted
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)))
)

Posted

nice ssg :)

i didn't suspect Acad is smart enough to check whether a given support path already exists :)

  • 1 year later...
Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...