ssget & use of variables

Discussion in 'AutoCAD' started by NancyM, Dec 23, 2003.

  1. NancyM

    NancyM Guest

    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 ()
     
    NancyM, Dec 23, 2003
    #1
  2. change the second one to something like:

    (ssget "X" (list (list 10 pt1x pt1y 0.0)))
     
    Luis Esquivel, Dec 23, 2003
    #2
  3. 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)))
     
    Tony Tanzillo, Dec 23, 2003
    #3
  4. NancyM

    Tom Berger Guest

    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
     
    Tom Berger, Dec 23, 2003
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.