richard3009 Posted May 16, 2012 Posted May 16, 2012 I have 500 autocad files and I wish to pull the border block name from each file, is there a way of doing this automatically Quote
MSasu Posted May 16, 2012 Posted May 16, 2012 The fact that you are using LT version may be a problem. Also, there are some unique criteria that qualify a block as border-block? Is the only block inserted in 0, 0 on layout? Or the name follows a certain pattern? Quote
richard3009 Posted May 16, 2012 Author Posted May 16, 2012 The blocks are in a layer called SF i have access to Autocad full version so can run routines Quote
BIGAL Posted May 17, 2012 Posted May 17, 2012 Ok can be done next question in the dwgs are the title blocks in layout tabs and are they named different or do you just get the first one and then next drawing, then output list to say a text file ? Dwgname location blockname. A bit more are all layout tabs identical ie the title block is always at say 0,0 this is important else it will find wrong block or need more code to work out its a title block. Maybe post sample dwg Quote
richard3009 Posted May 17, 2012 Author Posted May 17, 2012 The block is in model space a routine that displayed every bloc in each file would do the job as the borders have names that are quite obvious, what Im aiming to to is a find and replace attribute within the borders of 500 drawings, my problem is that the drawings have different block names for the borders in many of the drawings, I just need to know all the names used and then I can target those specific names. Quote
BIGAL Posted May 18, 2012 Posted May 18, 2012 (edited) Here is a start got it from http://www.cadtutor.net/forum/showthread.php?41652-rename-all-blocks-adding-a-letter Bit rough but gives idea replace princ name with write to file etc (vl-load-com) (setq acdoc (vla-get-ActiveDocument (vlax-get-acad-object)) blocks (vla-get-Blocks acdoc) ) (setq dwgname (getvar "dwgname")) ; also need to out put this first (ssget "_X" '((0 . "INSERT"))) (vlax-for b (setq ss (vla-get-ActiveSelectionSet acdoc)) (setq name (vla-get-name b)) (princ name) ) (princ) Edited May 18, 2012 by BIGAL dwgname Quote
Dadgad Posted May 18, 2012 Posted May 18, 2012 The block is in model space a routine that displayed every bloc in each file would do the job as the borders have names that are quite obvious, what Im aiming to to is a find and replace attribute within the borders of 500 drawings, my problem is that the drawings have different block names for the borders in many of the drawings, I just need to know all the names used and then I can target those specific names. Perhaps this lisp from Lee would be helpful? I haven't gotten around to playing with it yet, but one of the seemingly nice things about it, is that it works without even needing to open the files, which when you are talking about 500 files, could certainly save you a lot of time. http://www.lee-mac.com/macatt.html Thanks Lee! 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.