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.
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.
I've can get a chart to count blocks and update, but only in Mechanical. Do you happen to have access to AutoCAD Mechanical?
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.
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)
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 ...
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
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.
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"}
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.