Passing .lsp variables to command calls

Discussion in 'AutoCAD' started by Scott Mcfarren, May 6, 2004.

  1. Has anybody figured out how to pass the CONTENTS
    of a variable that contains a list of data (say x & y of several points for
    example) to a command call ? :(command "pline" PNTLIST "") where PNTLIST is
    a
    list of variables - each containing a x & y value.
    Actually, I have this problem in similar conditions where
    the command interpreter wants to read the variable name
    literally instead of using its contents as the answer to a prompt it has
    made.
    Thanks, Scott
     
    Scott Mcfarren, May 6, 2004
    #1
  2. Scott Mcfarren

    Tom Smith Guest

    (command "pline")
    (foreach n ptlist)
    (command n))
    (command "")
     
    Tom Smith, May 6, 2004
    #2
  3. Scott Mcfarren

    Tom Smith Guest

    Actually, I have this problem in similar conditions where
    made.

    Variable passed to the (command) function are evaluated as they are in any
    lisp expression. They're not taken literally unless you quote the variable
    name.

    The problem may be that you're not passing the correct type of data, as in
    this case. You can't pass a list of points to a prompt for a point, you have
    to go through the list and pass each point separately.

    A good way to see what's happening with the command function is to set
    cmdecho=1 so you can see what the prompts and errors are actually saying.
     
    Tom Smith, May 6, 2004
    #3
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.