Jump to content

Editing/Deleting Layout Title blocks externally of AutoCAD


Alexw89

Recommended Posts

Good Morning Folks!

 

I trust you are all well? I apologise in advance if this is not posted correctly. I'm new to this forum as I signed up for some assistance on a particular thought I'm having and would be grateful for your help. I've been working for a House Builder for about 4 years now and have come to use a wealth of Lee Mac's Lisp functions (I can't stress how much they've helped me, such a help!) as there is tendency to have a lot of repetition including Titleblocks being renamed with standard house types.

 

What I'm looking for is whether there might be a way of editing titleblocks and deleting layouts outside of a drawing (possibly like a dialog box or similar?). It would cut the amount of time substantially spent changing titleblocks. I'm open to learning some code unless people have already encountered similar ideas I would appreciate the help!

 

Many Thanks

 

Alex W

Link to comment
Share on other sites

Why do you need to keep changing title blocks? There may be a simple solution to what you're wanting to accomplish. You can always use a different title block in either a new layout or a new drawing using the other as an xref.

Link to comment
Share on other sites

Hi Tombu. Thanks for the prompt response! The reason being is we have a set of core standard house type drawings that are then Xref'd into individual site folders. These are then honed down by deleting the layout tabs that aren't applicable and then the titleblock is amended to show the specific site address. If you have any particular ideas I would be open to any suggestions? Also if you want I could send a layout to give you a better idea as to what I'm trying to achieve.

 

Thanks

 

Alex W

Link to comment
Share on other sites

Is that specific site address stored in a title block attribute? Is it different for each layout? Can you attach a small example with the site address you want changed with the new address?

 

I like to reference custom drawing properties as they're easy to modify, you can use reference Sheet Set variables as well.

Link to comment
Share on other sites

Simplest would be to name the drawings with the address and use a field (%%) with the "Filename only" and with "Display file extension" unchecked in the attribute. Then you would never need to modify the attribute again.

 

There are lisp routines to modify the attribute using the block and tag names, but you would need to provide the specific site address for each drawing.

Link to comment
Share on other sites

Cheers that's something to work with definitely! Could this be linked to something like a text or excel sheet to ensure both lines of text for the address

Link to comment
Share on other sites

Cheers that something to work definitely! Could this be linked to something like a text or excel sheet to ensure both lines of text for the address

 

It could be done with lisp, are you talking about one sheet for each drawing or referencing two specific lines from one sheet for all drawings? Would this be easier than modifying the attribute?

Link to comment
Share on other sites

You just appload it or in our case pick from a pull down menu.

 

Note its an example you will need to customise for your exact block name and attribute tag names. I ahve a few others that do the same thing bottom line is find a block in a layout tab and change certain attributes using tag name.

 

Again an example of setting up multiple tags to change.

 

(setq oldtag1 "SHT_NO") ;attribute tag name

(setq oldtag2 "DRG_NO") ;attribute tag name

(setq oldtag3 "PROJ_NO") ;attribute tag name
(setq newstr3 "2010026")

(setq oldtag4 "REV_NO") ;attribute tag name
(setq newstr4 "PA")

(setq oldtag5 "PROJECT_DESCRIPTION") ;attribute tag name
(setq newstr5 "SEALING OF ROADS")

(setq oldtag6 "PROJECT_TITLE") ;attribute tag name
(setq newstr6 "NORTH EAST ")

(setq oldtag7 "DIRECTORY") ;attribute tag name
(setq newstr7 "MELWAYS")

(setq oldtag8 "MAP_REF") ;attribute tag name
(setq newstr8 "444&445")

; then 
(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
       (if (= oldtag2 (strcase (vla-get-tagstring att)))
       (vla-put-textstring att newstr2) 
       ) ; end if
       (if (= oldtag3 (strcase (vla-get-tagstring att)))
       (vla-put-textstring att newstr3) 
       ) ; end if
       (if (= oldtag4 (strcase (vla-get-tagstring att)))
       (vla-put-textstring att newstr4) 
       ) ; end if
       (if (= oldtag5 (strcase (vla-get-tagstring att)))
       (vla-put-textstring att newstr5) 
       ) ; end if
       (if (= oldtag6 (strcase (vla-get-tagstring att)))
       (vla-put-textstring att newstr6) 
       ) ; end if
       (if (= oldtag7 (strcase (vla-get-tagstring att)))
       (vla-put-textstring att newstr7) 
       ) ; end if
       (if (= oldtag8 (strcase (vla-get-tagstring att)))
       (vla-put-textstring att newstr8) 
       ) ; end if
       (if (= oldtag14 (strcase (vla-get-tagstring att)))
       (vla-put-textstring att newstr14)
       )
       (if (= oldtag15 (strcase (vla-get-tagstring att)))
       (vla-put-textstring att newstr15)
       )
       (if (= oldtag16 (strcase (vla-get-tagstring att)))
       (vla-put-textstring att newstr16) 
       )
       (if (= oldtag18 (strcase (vla-get-tagstring att)))
       (vla-put-textstring att newstr18) 
       )
       (if (= oldtag19 (strcase (vla-get-tagstring att)))
       (vla-put-textstring att newstr19) 
       )
       (if (= oldtag20 (strcase (vla-get-tagstring att)))
       (vla-put-textstring att newstr20) 
       )

Link to comment
Share on other sites

  • 2 weeks later...

Hi Bigal!Thanks very much for your assistance in this, apologies for not getting back to you sooner (I've been away for a couple of weeks on holiday in the South of France), I appreciate the help and just wanted to thank you for what you've sent through, I'll be giving that a go! Alex

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