ssget & use of variables

NancyM

Usenet Archive
Joined
Dec 23, 2003
Messages
1
Reaction score
0
AutoCAD2000...ssget & variables at "10"

why does this work...
(ssget "X" '((10 20 -12 0.0)))

and this does not...
(setq pt1x 20)
(setq pt1y -12)
(ssget "X" '((10 pt1x pt1y 0.0)))

I really need to have the x & y values as variables.

Appreciate any input. Have a great Christmas!
NancyM
 
change the second one to something like:

(ssget "X" (list (list 10 pt1x pt1y 0.0)))
 
You are quoting a list that contains variables that
require evaluation.

IOW:

(setq a 10 b 20 d 30)

'(a b c) -> (a b c)

(list a b c) -> (10 20 30)

Instead of quoting the list, use LIST:

(ssget "x" (list (list 10 pt1x pt1y 0.0)))
 
NancyM said:
and this does not...
(setq pt1x 20)
(setq pt1y -12)
(ssget "X" '((10 pt1x pt1y 0.0)))

I really need to have the x & y values as variables.

It doesn't work, because you are using the QUOTE symbol which prevents the evaluation of your variables.

Use (ssget "X" (list (list 10 pt1x pt1y 0.0))) instead.

Tom Berger
 

Latest threads

Back
Top