Hurricane for Autodesk® AutoCAD®
When you insert a block that has attributes (and you are not exploding it with
*blockname), AutoCAD asks for a value for each attribute. Typing at the keyboard, that is a minor annoyance. In a batch script it is a showstopper: the script either answers the wrong prompt or, if the attribute dialog box opens, stops and waits for you.Two system variables control this behavior:
Variable 0 1 (default) ATTREQ No prompts. Every attribute gets its default value. AutoCAD asks for each attribute value. ATTDIA The prompts appear on the command line (script-friendly). A dialog box opens (stops a script). Option 1: skip the prompts (ATTREQ 0)
Use this when the default values are fine, or when you will fill them in later with -ATTEDIT or the title block update feature.
ATTREQ 0 -INSERT TITLEBLOCK 0,0 1 1 0 ATTREQ 1The lines after
-INSERTanswer the block name, insertion point, X scale, Y scale and rotation prompts. The last line turns prompting back on for your users.Option 2: fill in the values from the script (ATTDIA 0)
Use this when each drawing needs real values. Keep ATTREQ at 1, make sure ATTDIA is 0 so no dialog box opens, then put one value per line after the rotation angle:
ATTDIA 0 ATTREQ 1 -INSERT TITLEBLOCK 0,0 1 1 0 PROJECT-2026-014 A-101 BKAutoCAD asks for the attributes in the order they were defined in the block, so the values must follow that order. Constant and preset attributes are not prompted for, so leave them out.
Not sure of the prompt order? Set ATTDIA to 0 and insert the block once by hand at the command line. Write down the prompts in the order they appear; that is the order your script needs.Keep script comments on their own lines (a line starting with
;). A comment after a value on the same line becomes part of the value. See How do I add comments to my scripts?Set it once for the whole batch in Hurricane
Instead of adding the variables to every script, put
ATTREQ 0(orATTDIA 0) in the PreBatch command on Hurricane's Settings tab, andATTREQ 1in the PostBatch command, so manual inserts behave normally again afterward. These variables and-INSERTneed no LISP, so this also works in AutoCAD LT.Related