Discussion of other Lisp dialects (Arc, Clojure, AutoLisp, XLISP, etc.)
-
arrowman
- Posts: 1
- Joined: Wed Dec 14, 2011 12:52 am
Post
by arrowman » Wed Dec 14, 2011 1:55 am
Hello,
I try to choose objects in one point. I use:
Code: Select all
(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.
-
nuntius
- Posts: 538
- Joined: Sat Aug 09, 2008 10:44 am
- Location: Newton, MA
Post
by nuntius » Wed Dec 14, 2011 9:25 am
From a web search, this appears to be Autolisp.
Here's your code, refactored to be more readable to my eye.
Code: Select all
(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.