Jump to content

change title block


alec

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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! :beer: :beer:

 

Lee probably has more appropriate choices than this one, specifically for attributes, but this one will do it, and is the REAL DEAL!

Edited by Dadgad
Link to comment
Share on other sites

Thanks BigAl, its not a tag I need to change, its text within the block itself. This is way above me I'm afraid!

Link to comment
Share on other sites

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! :beer:

Link to comment
Share on other sites

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...