Wednesday, November 21, 2012

Diesel Macro Auto Increment Numbers...

I received a question the other day from some one wanting to know how to automate sequential numbering in AutoCAD LT. So, i thought that this would be a good topic to put out there because I am sure that others have wanted to know if this was possible as well.
Anyways...to the topic.

First, the Macro:

*^c^c_text;\;0;$M=$(+,$(getvar,USERR1),$(getvar,USERR2));setvar;USERR1;
$M=$(+,$(getvar,USERR1),$(getvar,USERR2));

One thing that you have to remember is that before you run the command you must the USERR1, and USERR2.

USERR1 value is going to be your initial value (i.e...99 to start with 100)
Then your USERR2 value is the increment in which you are wanting to increase with each placement of text.
To set these values type userr1 into your command line and hit enter and then enter in the initial value
see pics below:



Once value is set for USERR1, press enter, and then repeat for USERR2.

Now that your starting and incremental value have been set you can run the command and start picking away.

*EDIT*
The above macro justified the text to bottom left; the below macro is modified to justify to middle center.

*^c^c_text;J;MC;\;0;$M=$(+,$(getvar,USERR1),$(getvar,USERR2));setvar;USERR1;
$M=$(+,$(getvar,USERR1),$(getvar,USERR2));


1 comment:

  1. Hi Matthew,

    I've been trying to adapt your script to allow for user input of the USERR1 and USERR2 values before it starts placing number.
    So far i've got
    ^C^C+
    _USERR1;\_USERR2;\
    *^C^C_text;\;; etc.etc.
    but when I add it to the section you have above, it stops working after the user input phase?
    I would also like to change the text height if that is possible?

    Chris.

    ReplyDelete