BCOUNT - Block counting with blocks in Arrays

BCOUNT - Block counting with blocks in Arrays

conveyor1
Enthusiast Enthusiast
443 Views
3 Replies
Message 1 of 4

BCOUNT - Block counting with blocks in Arrays

conveyor1
Enthusiast
Enthusiast

in the attached DWG, I have an initial block, the same block in an array, and the same block in an array that used the array classic.  If I then do a BCOUNT, the BCOUNT will report 17 blocks.  these are the single block that I used as the base and then the 16 blocks created using the ARRAYCLASSIC.  It does not count the blocks in the ARRAY.  The only way to get a count of these blocks is to explode the array.  Does anyone know of a C# way to report out a block count in the DWG that also include blocks inside ARRAY's?

0 Likes
444 Views
3 Replies
Replies (3)
Message 2 of 4

jreidKVSUZ
Advocate
Advocate

I tried the LISP have have and it does the same #C for your Array.

 

But did a search and found this request from the past.


It gives you the count but you have to do some leg work to get it. See attached Excel file Cell A26.

Link to Original creator:  https://forums.autodesk.com/t5/autocad-forum/bcount-array/td-p/7546484

 

Hope this helps!

JRR!

0 Likes
Message 3 of 4

jreidKVSUZ
Advocate
Advocate

Just found what you need.

It is tricky to work with but use all of the options and it will give you the count you need for the ARRAY or any blocks.

Here is the Original Creator's link:  https://forums.autodesk.com/t5/autocad-for-mac-forum/countv1-5-lsp-counting-blocks-for-autocad-in-ma...

I have attached the LISP file here and the command to use after locating is COUNT. Once your run the command. If you make the ARRAY larger it will automatically update the count.

 

Hope this give you what you need.

Thanks, JRR!

jreidKVSUZ_0-1738945458832.png

 

0 Likes
Message 4 of 4

ActivistInvestor
Mentor
Mentor

The files in this repository folder should do what you need. They are distilled versions of other more complex classes from the same library (that have too many dependencies to use without dragging in a lot of other code).

 

The code includes an example (the 'DEEPBCOUNT' command) that should report the number of insertions the user actually sees.

 

In the clip below, I added 3 nested block references to the block that is arrayed. One of the two blocks is inserted twice.

 

acad_dQOxaL1uPh.gif

0 Likes