Getting Point or Keyword ?

Discussion in 'AutoCAD' started by ECCAD, Sep 18, 2004.

  1. ECCAD

    ECCAD Guest

    For the guru's. I'm aware of the (initget) and (getkword)..but
    what's the most reliable / best way of getting either a Point, or a Character - using a single prompt..something like..
    (initget Pick Undo Retry P U R)
    (setq x (getkword "\nPick a Point / Undo / Retry <Retry>"))

    What I'm after is a way to 'loop' (while.., and either have the operator Pick a Point, or input a Character from the keyboard.

    Any help would be appreciated.
    Thanks,
    Bob
     
    ECCAD, Sep 18, 2004
    #1
  2. ECCAD

    Jeff Mishler Guest

    (initget "Pick Undo Retry")
    (setq x (getpoint "\nPick a Point / Undo / Retry <Retry>"))

    This will loop itself until the user either
    selects a point, returns the point
    Types "U", enter ("U" can be: U u Undo undo) returns Undo
    Types "R", enter ("R" ......ditto) returns Retry
    presses enter returns nil
     
    Jeff Mishler, Sep 18, 2004
    #2
  3. ECCAD

    ECCAD Guest

    Yo, Jeff,
    Thanks a mil. That will do it.

    Bob
     
    ECCAD, Sep 18, 2004
    #3
  4. ECCAD

    ECCAD Guest

    ECCAD, Sep 18, 2004
    #4
  5. ECCAD

    Jürg Menzi Guest

    Hi Jeff
    and typing 'P' returns 'Pick'...

    I would suggest:
    Code:
    (initget "Undo Retry")
    (setq x (getpoint "\nPick a Point or [Undo/Retry] <Retry>"))
    (cond
    ((= (type x) 'LIST) (DoPoint))
    ((eq x "Undo") (DoUndo))
    (T (DoRetry))
    )
    
    Square brackets allow the user to select options also by context menu...

    Cheers
     
    Jürg Menzi, Sep 19, 2004
    #5
  6. ECCAD

    steve Guest

    You could use (grread) to monitor the input that may be
    performed by the operator and to then react in the
    appropriate fashion. We have made similar functions.

    Steve at Steveg at BPCL dot Net


    Character - using a single prompt..something like..
    Pick a Point, or input a Character from the keyboard.
     
    steve, Sep 19, 2004
    #6
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.