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

SSGET CP Filter

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
codyhornyak
562 Views, 9 Replies

SSGET CP Filter

Hello,

 

I am trying to use the CP ssget filter to create a selection set of all the attributed blocks that cross a polyline. I am basically doing this:

(setq p_list (list p_west p_east))
(ssget "_CP" p_list '((0 . "INSERT")(66 . 1)))
  1. Is this the correct filter to use? My inputs are the start and end points of the polyline
  2. Will this filter work if the two points have the same x-coordinate or the same y-coordinate

Attached is my LISP so far and a sample drawing with the polylines and blocks. Thanks.

9 REPLIES 9
Message 2 of 10
codyhornyak
in reply to: codyhornyak

Something else I was trying was this, but I couldn't get it to work either

(ssget "C" 'p_west 'p_east '((0 . "INSERT")(66 . 1)))

 

Message 3 of 10
calderg1000
in reply to: codyhornyak

Regards @codyhornyak 

Here you have two options...

;;;Option 1
(ssget "_f" p_list '((0 . "INSERT")(66 . 1))))
;;;Option 2
(ssget "_c" p_west p_east '((0 . "INSERT")(66 . 1))))

 


Carlos Calderon G
EESignature
>Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

Message 4 of 10
codyhornyak
in reply to: calderg1000

The second option worked for me. The AutoLISP developer's guide isn't clear on which selection set methods you need underscores for or on when you need apostrophes in front of points. Thanks

Message 5 of 10
calderg1000
in reply to: codyhornyak

here is an answer for the "." and the "_"
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/significance-of-before-a-command-nam...
It's strange that it doesn't work. Seems to be the same, but this should work
(ssget "_f" (list p_west p_east) '((0 . "INSERT")(66 . 1)))


Carlos Calderon G
EESignature
>Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

Message 6 of 10
Sea-Haven
in reply to: codyhornyak

Just my thoughts on the subject.

The CP is Crossing polygon, ie you must have at least 3 points making a closed type object note a rectang would have, pt1 pt2 pt3 pt4 pt1 note the last pt1 ensures closed shape. Gets what is touched. Else have a U.

The WP is get objects within a polygon of points.

The C is crossing, think of a line touching objects.

The F is fence, think of a pline gets what it touches.

The W is use a window 2 points are ok. Left-right v's Right-left can be different will check.

 

Message 7 of 10
Kent1Cooper
in reply to: codyhornyak


@codyhornyak wrote:

Something else I was trying was this, but I couldn't get it to work either

(ssget "C" 'p_west 'p_east '((0 . "INSERT")(66 . 1)))

Don't use the  '  before variable names.

Kent Cooper, AIA
Message 8 of 10
ВeekeeCZ
in reply to: codyhornyak


@codyhornyak wrote:

...The AutoLISP developer's guide isn't clear on which selection set methods you need underscores for or on when you need apostrophes in front of points. Thanks


Never mind underscores if you use the English ACAD version.

I can't think of a single situation where apostrophes were required before point. Would you show us that part of the guide which so confuse you?

Message 9 of 10
codyhornyak
in reply to: ВeekeeCZ

The examples in this SSGET in Guide  were confusing me @ВeekeeCZ 

Message 10 of 10
ВeekeeCZ
in reply to: codyhornyak

I see, there is (ssget '(2 2)) for example where '(2 2) represents a point coordinates.

 

That apostrophe has nothing to do with ssget. It's just the simplest way to define a list of point coordinates: '(2 2).

(list 2 2) will give you the same result. But (list) can evaluate variables. (setq a 2) (list a a) but not '(a a)

 

Save to a variable: (setq pt '(2 2))

or the same by list (setq pt (list 2 2))

 

Now, using that variable within ssget: (ssget pt)

 

 

Also found THIS Lee's explanation.

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

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report