[LISP] ssget - passing a value through a variable

[LISP] ssget - passing a value through a variable

iBlachu
Advocate Advocate
395 Views
1 Reply
Message 1 of 2

[LISP] ssget - passing a value through a variable

iBlachu
Advocate
Advocate

Hi,

 

This notation is correct:

(setq a (ssget '((2 . "b1,b2"))))

 

But how to convey alternate names?

(setq v "b1,b2")

(setq a (ssget '((2 . v)))) - did not work

 

0 Likes
Accepted solutions (1)
396 Views
1 Reply
Reply (1)
Message 2 of 2

_gile
Consultant
Consultant
Accepted solution

Hi

the quote (') is used to avoid evaluation. Use a (list (cons ...)...) expression  instead.

(setq a (ssget (list (cons 2  v))))


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub