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.

variable filter-list item

4 posts · 2211 views

I actually find a block in a drawing with :

(setq ss (ssget "_X" '((2 . "blockname"))))

But I want the blockname to be a variable.

So I want to do :
(setq a "blockname") and then
(setq ss (ssget "_X" '((2 . a)))).
But this do not work. I tries : (list a), (setq a) but that doesn't work either
thanks

Re: variable filter-list item

Because you are using single-quote (') your A symbol is not being evaluated.

Try using back-quote instead:
(setq ss (ssget "_X" `((2 . ,a)))).

Re: variable filter-list item

A version without backquote would look like:
(setq ss (ssget "_X" (list (cons 2 a))))

Re: variable filter-list item

Thanks Edgar, that work