Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

SSGET CP Filter

codyhornyak
Advocate

SSGET CP Filter

codyhornyak
Advocate
Advocate

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.

0 Likes
Reply
Accepted solutions (1)
688 Views
9 Replies
Replies (9)

codyhornyak
Advocate
Advocate

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)))

 

0 Likes

calderg1000
Mentor
Mentor
Accepted solution

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.

codyhornyak
Advocate
Advocate

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

0 Likes

calderg1000
Mentor
Mentor
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.

Sea-Haven
Mentor
Mentor

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.

 

0 Likes

Kent1Cooper
Consultant
Consultant

@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
0 Likes

ВeekeeCZ
Consultant
Consultant

@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?

0 Likes

codyhornyak
Advocate
Advocate

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

0 Likes

ВeekeeCZ
Consultant
Consultant

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.

0 Likes