getkword returns command command at prompt?

Discussion in 'AutoCAD' started by Sage Cowsert, Jan 12, 2004.

  1. Sage Cowsert

    Sage Cowsert Guest

    (defun C:test ()
    (INITGET "Numeric Text Options Reset Exit")
    (GETKWORD "[Numeric/Text/Options/Reset] <Exit>: ")
    (princ)
    )

    Returns:
    [Numeric/Text/Options/Reset] <Exit>:
    command:
    command:

    At the command line. Why? How do I get it not display both command:'s?

    Thanks Sage
     
    Sage Cowsert, Jan 12, 2004
    #1
  2. Sage Cowsert

    Rudy Tovar Guest

    (initget 1 "Numeric Text Option Reset Exit")
     
    Rudy Tovar, Jan 13, 2004
    #2
  3. Sage Cowsert

    Sage Cowsert Guest

    I'm ok with nil being an answer. Btw... Even with the 1 there I still get
    two commands returned at the command line.

    Thanks Sage


     
    Sage Cowsert, Jan 13, 2004
    #3
  4. Sage Cowsert

    John Uhden Guest

    You have to use a dummy (command ...) inside your otherwise commandless
    function, e.g.

    (defun C:TEST ()
    (setvar "cmdecho" 0)
    (command "_.expert" (getvar "expert"))
    (princ "\nTesting.")
    (princ)
    )
     
    John Uhden, Jan 13, 2004
    #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.