This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

Get objects in one point

2 posts · 6368 views

Hello,
I try to choose objects in one point. I use:
(setq PtsList ( list (setq P1(getpoint "P1")) (setq p2(getpoint P1 "P2")) ))
setq ss (ssget "CP" PtsList))
(prin1 (sslength ss ))
I choose two times the same point. And I have error:
; ----- Error around expression -----
(SSLENGTH SS)
;
; error : bad argument type <NIL> ; expected SELECTIONSET at [SSLENGTH]
Please, help me:-)

Regards,
A.

Re: Get objects in one point

From a web search, this appears to be Autolisp.

Here's your code, refactored to be more readable to my eye.
(setq P1 (getpoint "P1"))
(setq p2 (getpoint P1 "P2"))))
(setq PtsList (list P1 p2))
(setq ss (ssget "CP" PtsList))
(prin1 (sslength ss))
Based on your error message, it appears that the ssget is failing and returning NIL instead of a SELECTIONSET object; but I don't know enough about that function to understand why.