CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.096.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator and the updated Barcode generator. New AutoCAD 2026 commands and variables.
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage 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.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedAudit Blocks

 Post Reply Post Reply
Author
ISElation View Drop Down
Groupie
Groupie


Joined: 07.Dec.2007
Location: United States
Using: AutoCAD Map 2011
Status: Offline
Points: 53
Direct Link To This Post 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?
Back to Top
msplcdykee69 View Drop Down
Senior Member
Senior Member


Joined: 15.Dec.2008
Location: United States
Using: Civil 3D, Map, Inventor, Mechanical, & Electrical
Status: Offline
Points: 163
Direct Link To This Post 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
Back to Top
ISElation View Drop Down
Groupie
Groupie


Joined: 07.Dec.2007
Location: United States
Using: AutoCAD Map 2011
Status: Offline
Points: 53
Direct Link To This Post 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
Back to Top
msplcdykee69 View Drop Down
Senior Member
Senior Member


Joined: 15.Dec.2008
Location: United States
Using: Civil 3D, Map, Inventor, Mechanical, & Electrical
Status: Offline
Points: 163
Direct Link To This Post 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
Back to Top
ISElation View Drop Down
Groupie
Groupie


Joined: 07.Dec.2007
Location: United States
Using: AutoCAD Map 2011
Status: Offline
Points: 53
Direct Link To This Post 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.
Back to Top
msplcdykee69 View Drop Down
Senior Member
Senior Member


Joined: 15.Dec.2008
Location: United States
Using: Civil 3D, Map, Inventor, Mechanical, & Electrical
Status: Offline
Points: 163
Direct Link To This Post 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
Back to Top
ISElation View Drop Down
Groupie
Groupie


Joined: 07.Dec.2007
Location: United States
Using: AutoCAD Map 2011
Status: Offline
Points: 53
Direct Link To This Post 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
)

Back to Top
zhb7 View Drop Down
Groupie
Groupie


Joined: 26.Apr.2008
Location: Canada
Status: Offline
Points: 31
Direct Link To This Post Posted: 06.Apr.2009 at 16:22
try  the comand "bcount"
Back to Top
msplcdykee69 View Drop Down
Senior Member
Senior Member


Joined: 15.Dec.2008
Location: United States
Using: Civil 3D, Map, Inventor, Mechanical, & Electrical
Status: Offline
Points: 163
Direct Link To This Post 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
Back to Top
ISElation View Drop Down
Groupie
Groupie


Joined: 07.Dec.2007
Location: United States
Using: AutoCAD Map 2011
Status: Offline
Points: 53
Direct Link To This Post Posted: 07.Apr.2009 at 15:30

bcount works great. Thanks for all the help

Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,184 seconds.