Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Next Question

1 REPLY 1
Reply
Message 1 of 2
safcadd08
249 Views, 1 Reply

Next Question

Hello,
I'm close to the end of my project,     I have...What I think is my last question ("yea..right"),
I don't want to  have to press "enter" as an answer to the prompt:
        (getint "Please Enter your Selection; 1, 2 or 3: "))


I would like to press 1, 2 or 3 and just go to the next prompt?

Any ideas,...?

Thanks,
Steve

1 REPLY 1
Message 2 of 2
pbejse
in reply to: safcadd08


@safcadd08 wrote:


I would like to press 1, 2 or 3 and just go to the next prompt?

Any ideas,...?

Thanks,
Steve



(Defun c:test  (/ ans)
      (prompt "Please Enter your Selection; 1, 2 or 3: ")
      (while (and (null ans)
                  (setq gr   (grread t 15 0)
                        code (car gr)
                        data (cadr gr)
                        )
                  )
            (if (= 2 code)
                  (setq ans (cond
                                  ((= data 49) 1)
                                  ((= data 50) 2)
                                  ((= data 51) 3)))))
      (alert (strcat "You Pressed Number " (itoa ans)))
      (setq next (getstring "\nEnter whatever string: "))
      (princ)
      )

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost