Jump to content

Auto-number Attributes in Autocad 2014 LT


arunz

Recommended Posts

It is possible to run a macro to increment an attribute number as you select blocks one by one, but the blocks need to have been inserted already and you would need to set the starting number first before you run the macro. If you could give more details and maybe post the block in question then someone could give a more detailed answer. You could also get a block to be inserted that increments an attribute number, it all depends on what exactly you are trying to do.

Link to comment
Share on other sites

  • 4 months later...

Attached is a copy of your drawing with a row of altered blocks, these are numbered out of order, if you use the following macro it will allow you to pick on the attributes and it will renumber the blocks, the macro uses two user defined variables called "count" and "inc", it also makes use of an attribute in the block with a tag of "one". the "*" at the start of the macro will make the macro repeat until you hit esc. Each time you run this you will need to initialise the start values first.

*^C^C^Csetenv;"count";$M=$(+,$(getenv,count),$(getenv,inc));-attedit;y;*;one;;\;v;r;$(getenv,count);;

but before you run that macro you will need to run this one that initialises the values for the two variables "count" and "inc"

^C^C^Csetenv;"count";1;setenv;"inc";1;

You can use something similar in order to insert a series of blocks with incremental number values.

Auto Number.dwg

Link to comment
Share on other sites

  • 5 years later...

Hello,

I am new in Autocad. I have Autocad LT2020 version.

I have series of circles which I need to number. I was looking for auto-numbering in LT version. 

I tried to use the macro above but I couldn't run it properly.

Could anyone please help me out with it?

 

While I am running the above macro, first it is asking me to select attribute. I am not sure what this attribute means. But I tried to select one of the circle, then it was looking for another corner and I couldn't understand what to select.

 

Thank you,

Sumana 

Link to comment
Share on other sites

This thread is about renumbering existing attributes, that's not what you want is it? It would be best to start a new post but include a dwg to show what you are wanting to do.

Link to comment
Share on other sites

The macro you need for this is

*^C^C._insert;2m_Brimstone_Survey;\1000;;;$M=$(getenv,count);setenv;count;$(+,$(getenv,count),1);

But you first need to run the setenv command and set 'count' = 1 (you need to do this each time you want to reuse the macro)

Just be aware that in the drawing you posted the circle block was scaled up by 1000, so that is why there is also the number 1000 in the macro.

If you want to run this in a different drawing then you will need to copy the block into that drawing first.

Link to comment
Share on other sites

Yeah LT cannot 'programmaticaly' find items in a drawing. It is down to the user to remember to do certain tasks like reset variables, or create numerous macro's.

Link to comment
Share on other sites

Hello Steven,

I may sound very stupid but I have few question,

 

1) What does it mean the drawing is Scaled up by 1000?

2) What measure I need to take if I try to use this macro for other drawing?

3) ^C^C^Csetenv;"count";1; is it the macro I need to run before the one you send to me? Then, do I need to store it in a different macro and run it before I run the macro for auto-numbering?

4) 

*^C^C._insert;2m_Brimstone_Survey;\1000;;;$M=$(getenv,count);setenv;count;$(+,$(getenv,count),1);

2m_Brimstone_Survey : this I believe is the file name. I need to change this name for other drawing. Am I right?

 

This much for now. Sorry for my stupid questions. I am a new user of AutoCad.

 

Thank you,

Sumana

 

Link to comment
Share on other sites

1) Not the drawing, it is the block that is scaled up, if you select one of the blocks in your drawing and look in the properties palette then you can see it has a scale factor of 1000, if you try and insert this block in your drawing it will be tiny.

2) Copy the block "2m_Brimstone_Survey" into the new drawing. There has to be at least the block definition in the drawing for this macro to work

3) Yes, it cannot be combined into one long macro it has to bee 2 separate macro's

4) That is the name of the block in the drawing you posted, you can change the name of the block, but you would then to change the name used in the macro.

 

Link to comment
Share on other sites

Hi Steven again "Useri1" is a integer variable available in the dwg 5 integers 5 reals 5 strings.  $(getvar,useri1) like wise  setvar,dimscale ? goes up to 32000

 

Has advantage its saved in the dwg. Disadvantage it can not renumber if you delete one.

Edited by BIGAL
Link to comment
Share on other sites

LT only has the 5 integers and the 5 reals, no string variables for some reason, but we do have setenv and getenv for strings. I prefer those because they can be more descriptive even for use with numbers it makes macro's a lot easier to read than trying to remember what each variable is holding.

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