Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Field that counts the number of blocks in AutoCAD

13 REPLIES 13
Reply
Message 1 of 14
Anonymous
5897 Views, 13 Replies

Field that counts the number of blocks in AutoCAD

After selecting "insert field", going under "Object", and selecting a block, for there to be a selction for the number of times that block is in a drawing. Data Extraction just isn't efficient or offer the flexibility to be a legitimate option for counting blocks.

13 REPLIES 13
Message 2 of 14
Patchy
in reply to: Anonymous

How about BCOUNT

Message 3 of 14
Anonymous
in reply to: Patchy

BCOUNT is cool, but it's not something that I can get to populate a field. It just seems like there should be a way to get CAD to help automate cut sheets, BOM's, ect.

Message 4 of 14
Anonymous
in reply to: Anonymous

Hello, I have the same issue here. I need to count a lot of parking spaces, they are nested in another block, each parking space have attributes for identification, etc. I was thinking in an option in the field categories that count blocks inside other block and auto-update if the amount of blocks nested is modified. Any ideas? Please?
Thanks in advance.
Message 5 of 14
Anonymous
in reply to: Anonymous

I've can get a chart to count blocks and update, but only in Mechanical. Do you happen to have access to AutoCAD Mechanical?

Message 6 of 14
Anonymous
in reply to: Anonymous

Not right now in this computer, but please tell me about that chart.
Message 7 of 14
Anonymous
in reply to: Anonymous

It's been a while since I've messed around with this, but this is what got me started down the path of being able to have the quantity of blocks in a drawing update a material list. When you get a chance to use something with Mechanical on it, give this a whirl. I can confirm that it works with both blocks and dynamic blocks.

 

Block Counter.jpg

Message 8 of 14
Anonymous
in reply to: Anonymous

Ok, thank you, I'll try it ASAP.
Message 9 of 14
johnaerickson68
in reply to: Anonymous

I know this was an old post but someone might need this answer in the future. 

My advice is to use the data extraction wizard

 

Make sure on page 2 of 8 in the Data Source section to choose select objects in the current drawing and then select everything in your drawing. The next few pages are about filtering out the available data from the objects you are  extracting from but the final table that you get will give you a table or output to a data file that includes the total count.  Whenever the number or blocks changes you can select your table and right mouse click to get to Update the Table Data Links which will update your data (i.e. recount the total number of blocks)

Message 10 of 14
amapostolou
in reply to: Anonymous

I found a way to add Count to a field.  Once the Count command is used, there's a graphic at the top that has other Count options.  One is to insert a Field.  When I select that, it asks where to place it, so I did.  It's a text element with a field.  If you double-click to edit, this is what gets displayed ... 

aapostolou62A7K_0-1648579577522.png

 

I am interested to find any documentation that explains what all that means and how to use it.

 

For now, I create the Field using Count, then copy and paste the Expression in my table, notes, etc. and delete the original Field that got placed.  A little time consuming.

 

Regards,

Anthony

Message 11 of 14
xsteinbachx
in reply to: amapostolou

I wish you were able to copy the code versus the screenshot. I don't get the same code as you, as yours seems to do the whole drawing.

Message 12 of 14
amapostolou
in reply to: xsteinbachx

Here's the actual text for different count searches.

 

{"countingArea":[],"key":{"parameters":[{"name":"Visibility1","unitType":0,"value":"3 Coils"}]},"name":"Coil_Insert","type":"block"}

 

{"countingArea":[],"key":{"parameters":[{"name":"Visibility1","unitType":0,"value":"2 Coils"}]},"name":"Coil_Insert","type":"block"}

 

{"countingArea":[],"key":{"parameters":[{"name":"Visibility1","unitType":0,"value":"1 Coil"}]},"name":"Coil_Insert","type":"block"}

 

{"countingArea":[],"key":{},"name":"BC1","type":"block"}

Message 13 of 14
xsteinbachx
in reply to: amapostolou

Thank you!

Message 14 of 14
jreidKVSUZ
in reply to: Anonymous

This is not fields but is one of the best LISP files I have used. But you must have Full AutoCAD and not Lite.

Type in AP and Drag Drop the BLOCKCOUNT.lsp into the folder that just popped up and select said file and load then type BLOCKCOUNT. This counts the blocks and makes your legend to show what the block looks like, the block name and how many.

I renamed the LISP file and its program name because I can remember BLOCKCOUNT but might forget what the original name was called.

 

One note, always do a search for a LISP file that may do what you are asking for.

 

Enjoy!

JRR!

 

The Original creator's Link:

https://forums.autodesk.com/t5/autocad-forum/block-count-tool-in-2022-version/td-p/10407475

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report