The Hurricane Forum
The Hurricane Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Hurricane for AutoCAD
 General Discussion
 I'm lost
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Jdetaylor
New Member



USA
6 Posts

Posted - February 24 2004 :  7:51:25 PM  Show Profile  Visit Jdetaylor's Homepage  Reply with Quote
okay, so I have and Excel calculation sheet that uses VB to generate a ".Tag" file listing each cell below each other and ready to import into the title block "TAG" module......I must be dense, because, I need to know (step by step please) how to generate a script and apply it to a specific block in a specific sheet

thanks
in advance.................John Taylor

Admin
Administrator



652 Posts

Posted - February 24 2004 :  9:57:20 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
Hi John,

I was preparing an e-mail, but since you ask here also... I'll respond here, in case anyone else is wondering...

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 the TB.dwg file)
Download Attachment: TB.zip
5.28 KB

INSERT this drawing 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.

However, if you type DDATTE in AutoCAD you should get a screen appear like this.
Download Attachment: DDATTE_TB.zip
12.19 KB

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


Now, how Hurricane fits 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.
Download Attachment: TBWiz-TB-Example.zip
30.13 KB
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.

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$. 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 so...
Download Attachment: UserTagManager.zip
26.34 KB

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 scripts that contain $TAG1$ become updated each time they are run!

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 script to the Hard Drive.

I hope this clears things up a bit better... I will work on the FAQ portion of this. Let me know if you have any questions.

If anyone has anything else to add, that would be great!

Regards,
Bill

Hurricane for AutoCAD
http://www.74mph.com
FAQ at
http://www.74mph.com/faq/faq.html
Tutorials at
http://www.74mph.com/tutorials.html
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Hurricane Forum © 2009 - 2021 Go To Top Of Page
This page was generated in 0.36 seconds. Snitz Forums 2000