Jump to content

automatic numbering of block atributes.. is it possible??


ottoatom

Recommended Posts

Hi there all!I am new here and have a lot af questions to ask, but I dont wont to bombard all of you with my questions, so I will go easy on you guys ;)

 

I am counting all the doors in a project in autocad 2008, but It is becoming to be a real pain in the but because every time I change some door, I have to renumber almost every door :x.. I am sure there is an easier way to do that.. I am using a block with atributes and I would like to know if there is a way autocad can number automatically each block atribute.. I know that with mtext it is very easy (I use in my parking spaces) but with blocks I dont know how to do it :( .. ne1 has a clue ? like each time I put a block the number gets updated, and each time I take one off it gets updated again..

 

thx a lot to all!!

Link to comment
Share on other sites

Do you want to just count them for your records or do you need to show the numbering on them?

 

Just to count them try the bccount command it will count that perticular block or all the blocks in the drawing.

Link to comment
Share on other sites

no, I want the count to be shown on the plans. The counting can be done also in the tables at the data extraction moment.. I need them to be shown, in order if possible, in the plan..

Link to comment
Share on other sites

Here try this after you extracted open the doc. so you can read the command. I can't remember where I found this at! as soon as I find where I found it I will let you know. save a copy for later.

 

Let us know if it works.

 

Hope this work, Good luck!8)

numbering.zip

Link to comment
Share on other sites

  • 2 years later...

You would need to use some advanced LISP to modify the attribute text. I'm using LT (no LISP), so I use 2 macros to modify the attributes...one to assign an initial number, and another to modify the attribute and increment the number by 1.

 

I assigned macro #1 to a custom button. Macro #2 is assigned to a shortcut key like CTRL+1, so I could use my left hand for the macro and my right hand to select blocks.

 

This process is "manual" but it speeds it up alot.

 

If your block has more than one attribute, you'll have to modify macro #2.

 

Macro #1 Assign initial number...

^C^Csetenv;NUMBER1;\

Macro #2 Modify attribute and increment number varialble...

^C^C-attedit;y;*;*;*;\;v;r;$M=$(getenv,NUMBER1);n;setenv;NUMBER1;$M=$(+,$(getenv,NUMBER1),1)

Hope this helps.

Link to comment
Share on other sites

You would need to use some advanced LISP to modify the attribute text. I'm using LT (no LISP), so I use 2 macros to modify the attributes...one to assign an initial number, and another to modify the attribute and increment the number by 1.

 

I assigned macro #1 to a custom button. Macro #2 is assigned to a shortcut key like CTRL+1, so I could use my left hand for the macro and my right hand to select blocks.

 

This process is "manual" but it speeds it up alot.

 

If your block has more than one attribute, you'll have to modify macro #2.

 

Macro #1 Assign initial number...

^C^Csetenv;NUMBER1;\

Macro #2 Modify attribute and increment number varialble...

^C^C-attedit;y;*;*;*;\;v;r;$M=$(getenv,NUMBER1);n;setenv;NUMBER1;$M=$(+,$(getenv,NUMBER1),1)

Hope this helps.

 

Thanks... I shall definitely give this a try;

Link to comment
Share on other sites

You're using AutoCAD 2006, and I have LT 2010. There might be slight variations as to how the command runs in your version. You can check by using -ATTEDIT at the command line and see if all of the options are the same as the macro.

Link to comment
Share on other sites

You can using lisp or VBA etc easily update your block attributes only one problem if done automatically it will renumber in the order the blocks were created not by location so you could end up with two doors near each other but with say door22 door65 as labels.

 

Anyway if you want a block attribute update program just search here under BIGAL I have posted the code a couple of times also check for Leemac he has posted stuff for this before also.

 

A hint that may be usefull

If you want the doors numbered left to right and top to bottom it could be done you make a block list then sort on the insertion point, then update.

 

Hint2 use the x,y to get the correct block after step one easier than manipulating two lists. (blockname x,y)

Link to comment
Share on other sites

  • 3 months later...
  • 2 years later...
You would need to use some advanced LISP to modify the attribute text. I'm using LT (no LISP), so I use 2 macros to modify the attributes...one to assign an initial number, and another to modify the attribute and increment the number by 1.

 

I assigned macro #1 to a custom button. Macro #2 is assigned to a shortcut key like CTRL+1, so I could use my left hand for the macro and my right hand to select blocks.

 

This process is "manual" but it speeds it up alot.

 

If your block has more than one attribute, you'll have to modify macro #2.

 

Macro #1 Assign initial number...

^C^Csetenv;NUMBER1;\

Macro #2 Modify attribute and increment number varialble...

^C^C-attedit;y;*;*;*;\;v;r;$M=$(getenv,NUMBER1);n;setenv;NUMBER1;$M=$(+,$(getenv,NUMBER1),1)

Hope this helps.

 

I realize this is a really old post, but can someone help with this? I am using Autocad Architecture 2012 and I am often numbering parking spaces... this kind of macro would be awesome. I can't seem to get it to work, do getenv and setenv work in non-LT autocad and if not how can I modify this macro? I'm currently using it as the "command" in a "run script" tool/icon

Link to comment
Share on other sites

I'm not familiar with Architectural 2012. Check for getenv and setenv in your help file. If those are valid commands, check the prompts when you enter -ATTEDIT at the command line (include the "-"). If you can send me an 2010 version of your parking space block, I'll see if I can help.

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