Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Count Blocks in paper space

7 REPLIES 7
Reply
Message 1 of 8
SurendraReddyM.6893
996 Views, 7 Replies

Count Blocks in paper space

Dear,

 

I need to count the blocks in paper space automatically. Is there any method or lisp for this.

 

Thanks,

 

7 REPLIES 7
Message 2 of 8

If you have express tools installed , try by typing BCOUNT

Message 3 of 8

Ya i know the bcount command but i need to count blocks on view ports automaticaly (By using lisp or any other). Actually the Bcount command is works on model space but not work on paper space.

Message 4 of 8

So you want to count all the blocks in the current Layout ?

If you have multiple layouts, want to count them also ?

 

Message 5 of 8
3wood
in reply to: SurendraReddyM.6893

It is not easy if the viewport only shows part of the model space.

For instance,

Is the block half-shown in the viewport included in the count?

Is it an xref in the model space?

Plus:

Nested blocks?

Blocks in array?

Different visiblity in dynamic blocks?

I'd like rely on BCOUNT to count the blocks in the model space.

Message 6 of 8

Here are a selection of block counters which may help:

 

Block Counter

Dynamic Block Counter

Nested Block Counter

Message 7 of 8

Thanks for the taht. I will take a look on this and confirm.

 

Message 8 of 8
dicra
in reply to: SurendraReddyM.6893

I'm not so sure that this is what you are looking for, but you can test it.

 

(defun c:blcount ()
  (setq sset (ssget "X" '((0 . "insert")(-4 . "<not") (410 . "model") (-4 . "not>") )))
  (setq sslen (sslength sset))
  (alert (strcat "Total number of blocks in paperspace is:  " (rtos sslen 2 0)))
  )
 

 Of course you can add some more filters to selection set, but if I understand what you need is that yours blocks are not in model space, and list 410 is important for that.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost