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

Box select with block filter?

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
mid-awe
669 Views, 8 Replies

Box select with block filter?

Hi all,

 

I know that this may seem trivial but I'm having difficulty sorting it out. I want to build a selectionset beginning with a box selection and then only return blocks by name into a selectionset.

 

(setq ss (ssget "X" (list (cons 0 "INSERT") (cons 2 "PP"))))

 Can't I just add some mode designation? If so then what, and should I be using the "X" also to ensure that I get all "PP" blocks within the box area?

 

Thank you in advance for any help.

8 REPLIES 8
Message 2 of 9
mid-awe
in reply to: mid-awe

(setq ss (ssget "_WP" (list (cons 0 "INSERT") (cons 2 "PP"))))

 I'd expect this to work but I only get a bad list  error.

Message 3 of 9
Ajilal.Vijayan
in reply to: mid-awe

ssget WP should call with point list argument also

 

(setq ss (ssget "_WP" point_List (list (cons 0 "INSERT") (cons 2 "PP"))))

 

 

Message 4 of 9
mid-awe
in reply to: Ajilal.Vijayan

Should I use "_CP" to allow the use to define the window or box selection
first?
Message 5 of 9
Kent1Cooper
in reply to: mid-awe


@mid-awe wrote:
Should I use "_CP" to allow the use to define the window or box selection first?

The CP selection method [as well as WP, C, W, and F] needs a pre-defined point list supplied to it.  You could ask the User to select points to put into that list, but I believe that needs to be before you get into (ssget), so the list of points can be supplied as an argument.

 

But the selection-method argument is optional.  If you want the User to build a selection area within the (ssget), you can just use (ssget) without any selection method, but with only the entity-type and Block-name filtering [your original without the "X"], and they can use whatever combination of selection methods they choose, including all those as well as individual pick-selection, removing, etc., just as they would for object selection in any editing command but with the benefit of the filtering.

Kent Cooper, AIA
Message 6 of 9
mid-awe
in reply to: Kent1Cooper

I was overthinking it 🙂
Thank you Kent.
Message 7 of 9
Lee_Mac
in reply to: mid-awe

Message 8 of 9
mid-awe
in reply to: Lee_Mac

Thanks Lee, your reference is where I started.
It was kents suggestions that solved it though..

Great reference BTW. 🙂
Message 9 of 9
Lee_Mac
in reply to: mid-awe

mid-awe wrote:
Great reference BTW. 🙂

 

Thanks! Smiley Happy

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

Post to forums  

Autodesk Design & Make Report

”Boost