Jump to content

Dynamically updating titleblocks


cadsultant

Recommended Posts

I have projects which contain a large number of sheets in each set. :idea: I would like to be able to create an external text file, which contains all the information pertinent to a particular project, for example project name, project number, etc... and have the attributes in my titleblock automatically updated according to the text file. This will allow me to change one text file, and all the common project information will be updated in all titleblocks.

 

RTEXT seems to be helpful for notes. Diesel as little as I know about it, seems to only extract information within the drawing. Can anyone please tell me where to look, or how to combine if at all possible, rtext and diesel, so that I can set each line with a variable name, so that I can insert portions of the same text file in different areas of the titleblock.

 

If there is a better way to get the results, please let me know which direction I can go. I appreciate any responses. Thanks in advance.

Link to comment
Share on other sites

The first thing coming up in my mind is XREF. Create a drawing containing only the title date block and XREF it in all your drawings belonging to a project. If you change the title date block AutoCAD will update all the other drawings to reflect the changes. Read more about the XREF in the AutoCAD Help file (or ask us :D )

If for some reasons do you need external files: create a Word document for each field. In your DWGs: Insert > OLE Object... >Create from file. Push the Browse button and navigate to the first document you just saved. Check the Link box and push OK.

Repeat these for each document, in each drawing.

The content of the documents is linked into the drawing. Change the DOC file and next time you open a dwg it will reflect the changes.

Link to comment
Share on other sites

Thanks for the reply Fuccaro. The xref idea is a deffinate option. However, is there a way to use your second alternative, using RTEXT and not OLE... and also using only one file with several variables. See the example below.

 

TITLE: TITLE GOES HERE

PROJECT NO: 5647

DESIGNED BY: ME

DRAWN BY: ME

Link to comment
Share on other sites

Cadsultant

It is possible to write a program for. Do you wish to update attributes in a block? Or maybe the text to be changed is just a text or mtext entitie placed wherever in the drawing?

Link to comment
Share on other sites

  • 4 years later...

Hi

 

New user here, but this is my same problem. I've got a text file, generated from another program, but would like to be able to "process" the text file, seperate out the values from the text file, then update / modify blocks within the CAD dwg and change the attributes within the titleblock.

 

For instance, I've attached a sample text file (sample_data.txt) that contains values in the following format: Point,localN,localE,lat27,long27,utm27Nutm27E,cm,lat82,long83,utm83N,utm83E,

 

and need to import those values from the text file into the attached blocks (vert-coords.dwg, vert-geo-coords, vert-utm-coords) in the corresponding attributes.

 

I've started a lisp (I'd rather lisp it) that allows users to select the text file, but then ?????

 

 
(defun c:vert-coords ()
      (setq  S_NOR_SOU 0
 S_NOF 0
  S_NBDY 0
 S_EAS_WES 0
 S_WOF 0
 S_EBDY 0
 S_SECT 0
 S_THEO 0
 S_N_UTM_27 0
 S_E_UTM_27 0
 S_N_UTM_83 0
 S_E_UTM_83 0
 DD_ZONE 0
 DD_Meridian 0
 S_LAT_27 0
 S_LONG_27 0
 S_LAT_83 0
 S_LONG_83 0
 S_LAT_27_DMS 0
 S_LONG_27_DMS 0
 S_LAT_83_DMS 0
 S_LONG_83_DMS 0);end setq
 (setq imfile (getfiled "Select the text file (*.txt)" "" "txt" )


);;; End defun

 

Any help would be much appreciated.....

 

Thanks,

 

J.

sample_data.txt

VERT-COORDS.dwg

VERT-GEO-COORDS.dwg

VERT-UTM-COORDS.dwg

Link to comment
Share on other sites

Not a problem to do for both requests, search here for "BIGAL" and "blocks" I posted the code to do a search for title block updating only a couple of days ago its in VBA find it easier to use when editing blocks.

 

You only need to add a read text file to it to read in the variables it will update over multiple layout tabs automatically.

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