
CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.
Please abide by the
rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
Author |
Topic Search Topic Options
|
ISElation
Groupie
Joined: 07.Dec.2007
Location: United States
Using: AutoCAD Map 2011
Status: Offline
Points: 53
|
Topic: Audit Blocks Posted: 31.Mar.2009 at 21:59 |
Is there a way to find out exactly what blocks are in a drawing and how many of each block there are?
|
 |
msplcdykee69
Senior Member
Joined: 15.Dec.2008
Location: United States
Using: Civil 3D, Map, Inventor, Mechanical, & Electrical
Status: Offline
Points: 163
|
Posted: 31.Mar.2009 at 22:12 |
Easiest way is to select one of the blocks right click your mouse select similar and then look at your properties window and it will tell you how many selected.
|
Engineering Manufacturing Medical Cables/Adjunct Instructor Engineering Graphics/Engineering Computations and Careers
msplcdykee69@yahoo.com
Shawn
|
 |
ISElation
Groupie
Joined: 07.Dec.2007
Location: United States
Using: AutoCAD Map 2011
Status: Offline
Points: 53
|
Posted: 31.Mar.2009 at 22:27 |
I do not have that "similar selection" option. Running the "ssx" command is way faster, but then i have the problems with the blocks being on different layers and having to add them up. I was just wondering if there is a way to export all the block names in a dwg and give me the number of each? AS QUICK AS POSSIBLE
|
 |
msplcdykee69
Senior Member
Joined: 15.Dec.2008
Location: United States
Using: Civil 3D, Map, Inventor, Mechanical, & Electrical
Status: Offline
Points: 163
|
Posted: 01.Apr.2009 at 04:25 |
here is a lisp program use this to count your blocks. when you type BLK in the command prompt select one of the blocks you wish to know the number of, then window over the area it will give you a count of total number of that particular block in that dwg.
(defun c:BLK () (SETQ LAY (CDR (ASSOC 2 (ENTGET (CAR (ENTSEL)))))) (setq sel (ssget (list (cons 0 "insert") (cons 2 lay)))) (setq sle (itoa (sslength sel))) (alert (strcat LAY " : " sle)) )
|
Engineering Manufacturing Medical Cables/Adjunct Instructor Engineering Graphics/Engineering Computations and Careers
msplcdykee69@yahoo.com
Shawn
|
 |
ISElation
Groupie
Joined: 07.Dec.2007
Location: United States
Using: AutoCAD Map 2011
Status: Offline
Points: 53
|
Posted: 01.Apr.2009 at 16:27 |
That lsp works great, but it would be nice to be able to select all the blocks in a drawing and display how many their are. With this lsp i dont really know if i get every block unless i get a list of all the blocks in the drawing first, and if i am doing this i might as well use the quick select command to find out the total for each. Thanks for all the help.
|
 |
msplcdykee69
Senior Member
Joined: 15.Dec.2008
Location: United States
Using: Civil 3D, Map, Inventor, Mechanical, & Electrical
Status: Offline
Points: 163
|
Posted: 01.Apr.2009 at 16:43 |
You can try to do a web search for lisp routines. someone out there may have written one to do exactly what your looking for. If I should happen to find one I will post it here.
|
Engineering Manufacturing Medical Cables/Adjunct Instructor Engineering Graphics/Engineering Computations and Careers
msplcdykee69@yahoo.com
Shawn
|
 |
ISElation
Groupie
Joined: 07.Dec.2007
Location: United States
Using: AutoCAD Map 2011
Status: Offline
Points: 53
|
Posted: 01.Apr.2009 at 18:01 |
I found this to work perfect.
(defun c:blkcount (/ ss lst itm result) (and (setq ss (ssget "x" (list (cons 0 "INSERT")))) (setq lst (mapcar '(lambda (x) (cdr (assoc 2 (entget x)))) (mapcar 'cadr (ssnamex ss))) ) (setq lst (vl-sort lst '>)) (while (setq itm (car lst)) (setq len (length lst)) (setq lst (vl-remove itm lst) cnt (- len (length lst)) result (cons (cons itm cnt) result) ) ) ) result )
|
 |
zhb7
Groupie
Joined: 26.Apr.2008
Location: Canada
Status: Offline
Points: 31
|
Posted: 06.Apr.2009 at 16:22 |
try the comand "bcount"
|
 |
msplcdykee69
Senior Member
Joined: 15.Dec.2008
Location: United States
Using: Civil 3D, Map, Inventor, Mechanical, & Electrical
Status: Offline
Points: 163
|
Posted: 07.Apr.2009 at 04:27 |
I never new about bcount.. Works great Thanks i will know for next time and i have added that to my Company standards.
|
Engineering Manufacturing Medical Cables/Adjunct Instructor Engineering Graphics/Engineering Computations and Careers
msplcdykee69@yahoo.com
Shawn
|
 |
ISElation
Groupie
Joined: 07.Dec.2007
Location: United States
Using: AutoCAD Map 2011
Status: Offline
Points: 53
|
Posted: 07.Apr.2009 at 15:30 |
bcount works great. Thanks for all the help
|
 |