Hurricane Tutorials are now online!
FAQ Index

How do I update the text in all my TitleBlocks?


First, you will have to create a common block that will reside in your drawings that will contain all the information and the format in which to display it. Be it a title-block for this example.

Inside that block (lets call it "TB"), have the "attributes" with tag names declared using the AutoCAD "ATTDEF" command. Lets assume that you have an attribute with a "Tag Name" of DRAWING_NAME, and another "Tag Name" of "DRAWN_BY".

(Note: These AutoCAD Tag/Attributes are not to be confused with Hurricanes TAGS (which I will always CAPITALIZE for emphasis)

(I've created a ZIP file with the TB.dwg file)

Download Zip Here

INSERT TB.dwg into your other drawings. You will notice that when you "INSERT" you will get some prompts like "DRAWN_BY:"... you can just hit [ENTER] to both prompts, and you should just see an empty box appear in your drawing.

Note: If you don't want AutoCAD to prompt you for the text attributes, then you can set ATTREQ to 0.

Once inserted into your drawing, if you type DDATTE in AutoCAD you should get a screen appear like this.

If you enter text into either of the boxes, and click OK, you will see it appear in your box.

(Note: If you explode the block in AutoCAD you will notice that the attribute names appear... this will be useful later on when you can't remember all the different attributes in a block. Just explode it to see, then UNDO)


How does Hurricane fit into this?


Hurricane has a built-in script creation Wizard, called "Title-Block Update Wizard". It has an interface that looks similar to the DDATTE edit window in AutoCAD. In it, you can specify the Title-Blocks (or any block with attributes) name, and specify what text should go where.

In our example, you might want to fill the boxes in the Hurricane Title-Block Update Wizard like this.

If you press the "CREATE" button in the Wizard, you should get a script created that looks like this...

(LOAD "C:/PROGRAM FILES/HURRICANE/LISP/TB_WIZ1.LSP")
;-------------
TB_WIZ1
TB
DRAWN_BY
John Smith
;-------------
TB_WIZ1
TB
DRAWING_NAME
$FILENAME$
REGEN
;-------------

This script loads a lisp routine that will (in the open DWG file) take the block specified, and pass the text to the AutoCAD attributes/tag name.

You can then save the script for later use.

Notice the use of the $FILENAME$ (Hurricane TAG). When you then "CREATE and RUN" the script in Hurricane, the $FILENAME$ portion will be REPLACED by the actual filename of the drawing being worked on in the Queue. Just perform a CREATE SCRIPT on a bunch of drawings with the above user script and see what the output looks like. You will notice that in each repetition of the user script the $FILENAME$ has been updated with the REAL drawing name.

(Note: To test this out, and see the results in the "output script", without actually making changes to your drawing. Click the "Create Batch Script" in Hurricane and NOT the "Create and Run Batch Script" button. (Make sure you have "Launch Batch Script in Text Editor when Created" checkbox selected (in the Tools->Options menu, GUI Tab), as this let you see the results each time you press the "Create Batch Script Button))


Now, with this in mind, what happens when our mysterious "John Smith" is no longer with the company and we need to update many MANY user script that have had "John Smith" hard coded into them??

This is where Hurricanes "STATIC TAGS" come into play. These are TAGS like $TAG1$ through $TAG40$.

Note: These tags normally would NOT go into your TB Block, they should reside in Hurricane only.

So, in the onset you could have declared that $TAG1$ was equivalent to John Smith in the User Tag Manager like this...

Then, inside your Title-Block Update Wizard, you can (instead of putting in "John Smith" as the Text for DRAWN_BY, you could have put "$TAG1$

And if "John Smith" has to be changed to any other text, you just update the Template file, and ALL USER SCRIPTS that contain $TAG1$ become updated each time they are run!

Try it now!

In which case your script would look like this...

(LOAD "C:/PROGRAM FILES/HURRICANE/LISP/TB_WIZ1.LSP")
;-------------
TB_WIZ1
TB
DRAWN_BY
$TAG1$
;-------------
TB_WIZ1
TB
DRAWING_NAME
$FILENAME$
REGEN
;-------------

When Hurricane runs this script, it will substitute both the $TAG1$ and the $FILENAME$ TAGS into the script before writing the "Batch Script" to the Hard Drive.

Once you are familiar with the power of these features, you may want to look at META-Commands, as with the ;TAG.TEMPLATE="" META Command, you can control which TAG Template is loaded depending on the script.

And once you get familiar with META Commands, take a look at Project TAGS!!


Previous Back to Hurricane for AutoCAD - FAQ Next