alec Posted April 30, 2018 Posted April 30, 2018 Morning, I have a title block saved as part of each layout that is part of my template file. I have recently moved house and need to change the address on the title block. Is there a quick way of doing this so that it changes in all previous jobs as well as future ones? Some of my projects run for many months and overlap the move date. It would mean changing each block on each layout in each job if not? Thanks. Quote
SLW210 Posted April 30, 2018 Posted April 30, 2018 You might could use a batch and a script, look around CADTutor on setting that up. I usually use the Design Center and the Redefine option. Quote
alec Posted April 30, 2018 Author Posted April 30, 2018 Thanks, I'll give it a try. I've altered the .dwt file for all future projects. Cheers. Quote
BIGAL Posted May 1, 2018 Posted May 1, 2018 It can be easily done as its your title block you know which block and which tag name. Here is an example. You could put a (load "myhousefix") in your acad.lsp so it will fix every dwg you open automatically. This is not tested as its been cut and pasted out of something else. (defun ah:sheetupdate1 ( / LEN ss1 lay oldtag1newstr1 ) (SETVAR "REGENMODE" 0) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vlax-for lay (vla-get-Layouts doc) (setq plotabs (cons (vla-get-name lay) plotabs)) ) (setq plotabs (vl-remove "Model" plotabs)) (setq oldtag1 "SHT_NO") ;attribute tag name (setq newstr1 "Your new address") (setq bname "Your block name") (setq ss1 (ssget "x" (list (cons 0 "INSERT") (cons 2 bname)(cons 410 tabname)))) (foreach att (vlax-invoke (vlax-ename->vla-object (ssname SS1 0 )) 'getattributes) (if (= oldtag1 (strcase (vla-get-tagstring att))) (vla-put-textstring att newstr1) ) ; end if (command "_.pspace") (COMMAND "ZOOM" "e") (PRINC (GETVAR "CTAB")) ) ; end foreach ) ; end foreach (SETVAR "REGENMODE" 1) ) ; end defun ah (setq curtab (getvar "Ctab")) (vl-load-com) (ah:sheetupdate1) (setvar "ctab" curtab) (princ) Quote
Dadgad Posted May 1, 2018 Posted May 1, 2018 (edited) Use LeeMac's BFIND lisp, you'll be glad you did. One of the absolute biggest time savers, I just got through using it twice looking through entire directories, but you only need to open a single file from that directory to set it up. Thanks Lee! Lee probably has more appropriate choices than this one, specifically for attributes, but this one will do it, and is the REAL DEAL! Edited May 1, 2018 by Dadgad Quote
alec Posted May 3, 2018 Author Posted May 3, 2018 Thanks BigAl, its not a tag I need to change, its text within the block itself. This is way above me I'm afraid! Quote
alec Posted May 3, 2018 Author Posted May 3, 2018 Thanks, I fell over on saving as the correct file type, no option for lisp etc. Quote
BIGAL Posted May 4, 2018 Posted May 4, 2018 Search here "Change text in a block" it exists. FIND may be your friend look at Lee-mac version. Quote
Dadgad Posted May 4, 2018 Posted May 4, 2018 Search here "Change text in a block" it exists. FIND may be your friend look at Lee-mac version. BFIND will do it just fine, been there, done that. 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.