• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

select all blocks in one click

  • Thread starter Thread starter zintonio
  • Start date Start date

zintonio

Guest
Hello.
I have a problem that I'm trying to solve but I can't go any further because my lisp language knowledge is miserable.

then I would like to create a function that allows me to select all the blocks present in a drawing by clicking on one. I tried to do this:

(defunc c:all (/n name sel )
; select all put blocks that have the name equal to the selected block.
(setq n (car(entsel "select block:")))
(setq name (cdr(assoc 2)))
(setq sel (ssget "_x" (cons 2 name))))
)

I am having little results, my goal is to:
1. write as command: all;
2. select the block;
3. all the blocks present in the drawing are selected;

all this comes from the fact that I found myself in front of drawings where there are blocks on unsuitable layers. Of course you will tell me there is the funz _qselect but it is too ruddy to use x that you have to remember the name of the block. what I would like to accomplish is something simple (command:all --> select the block --> fine)

Thank you.
 
You have to tell him to capture the blocks, besides the name...

(setq sel (ssget "_x" (cons 0 "insert") (cons 2 name))))


p.s. insert a space before n.
(defunc c:all (/n name sel )
 
Thank you very much,

I didn't know I had to catch the blocks.

Now it works....in the sense that it selects internally, but I can't see the selection to change the layer or to perform other operations. Is there a way to get the same result as the _qselect?

Thank you.
 
Hello.
perhaps I am not appropriate considering that it is the lisp section however I would like to understand why create an ad hoc lisp and not use the quick selection command from the property window (_.qselect by keyboard).
Thank you.
 
Hello.
perhaps I am not appropriate considering that it is the lisp section however I would like to understand why create an ad hoc lisp and not use the quick selection command from the property window (_.qselect by keyboard).
Thank you.
the reason zintonio explained:
....of course you will tell me there is the funz _qselect but it is too hot to use x that you have to remember the name of the block. what I would like to accomplish is something simple (command:all --> select the block --> fine)
 
I did a command to count the blocks of a design:

After launching, we are asked for the block name (if you need to type it) or press Enter to find the required block by clicking on one of them.

the lisp then returns the n. of found blocks and asks if we want to highlight these blocks by clicking in an empty area of the design. this allows to start a series of lines that combine that point to the point of insertion of the blocks that were found. ....a good help for complex designs!
if instead of the point we send out from the command.

Well ... the important thing is that the found blocks were put in a selection set: This means that if we want to move them or delete them all together, you just need to select them with "p" (previous).

e.g.
command: erase <invio>select objects: p <invio> ....</invio></invio>
 

Attachments

I did a command to count the blocks of a design:

After launching, we are asked for the block name (if you need to type it) or press Enter to find the required block by clicking on one of them.

the lisp then returns the n. of found blocks and asks if we want to highlight these blocks by clicking in an empty area of the design. this allows to start a series of lines that combine that point to the point of insertion of the blocks that were found. ....a good help for complex designs!
if instead of the point we send out from the command.

Well ... the important thing is that the found blocks were put in a selection set: This means that if we want to move them or delete them all together, you just need to select them with "p" (previous).

e.g.
command: erase <invio>select objects: p <invio> ....</invio></invio>
in the 2010 version does not act.
 
impossible: I am making it work now on autocad 2010!

Did you do everything correctly?
obviously first you have to load and launch conblok, select the blocks to find, exit with sending or clicking in a blank point
and finally give the command delete or copy etc and select the previous blocks with "p" ....
 
impossible: I am making it work now on autocad 2010!

Did you do everything correctly?
obviously first you have to load and launch conblok, select the blocks to find, exit with sending or clicking in a blank point
and finally give the command delete or copy etc and select the previous blocks with "p" ....
Excuse me. :redface: I insisted to type conblock instead of conblok ... I read it and read it with one more c. :redface:
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
ciao
Back
Top