counting blocks in a drawing
is there a quick way to count how many times a certain block exist in a drawing?
(does all blocks has to be in the same layer ? )
Comments
-
Just save this code to LSP file and load it:
[code](setq bname (getstring "\nBlock name : " ))
(setq q (itoa (sslength (ssget "_X"
'((-4 . "<AND")(0 . "INSERT")(cons 2 bname)(-4 . "AND>"))
))))
(alert (strcat bname " : " q))[/code]
regards, Vaidas0 -
Find as attachment.0
-
it still does not work, same error message
but I did find this menawhile - http://www.cadtutor.net/forum/showthread.php?21515-Lisp-to-count-blocks-on-specific-layers
yours is lighter though, would really like it to work
0 -
Just save this code to LSP file and load it:
regards, VaidasHi VaidasWe have some problems with parsing < and > in the forum. More information in this topic.Could you please file a support requests as well? We will try to solve this asap.Sander0 -
In the Drawing Explorer - Blocks, choose 'Detail View'. The number of times a block is inserted in the drawing shows in the 'References' column.0
-
Louis thank you this is helpful,
also I found this pretty impressive code : http://lee-mac.com/blockcounter.html
0 -
I have a LISp that checks for the occurence of a list of blocks and then sums them up by layer and prints this to a file. It also makes some small calculations on the sums before printing the file. Tell me if you need it.
Patrik
0 -
Patrik, I'm using the code I introduced in comment #6, but I'd be happy to check your lisp routine too
0 -
Here, and a sample of the files it looks for. It also looks for lengths of certain lines in these layers.
Hava a look. Maybe something you can alter. PAtrik
0