Lisp Ask User to Press Enter Before Continuing

  1. #1

    tany0070 is offline

    100 Club


    Default Run a LISP command after pressing ENTER or right-click in AutoCAD

    hi pple, is there any way to cause a lisp command like erase a line etc. to run only after the user performs certain critirial like pressing enter or right clicking the autoCAD screen? thanks.

  2. #2

    abdulhuck is offline

    I could stop if I wanted to


    Default Re: Run a LISP command after pressing ENTER or right-click in AutoCAD

    Quote Originally Posted by tany0070

    hi pple, is there any way to cause a lisp command like erase a line etc. to run only after the user performs certain critirial like pressing enter or right clicking the autoCAD screen? thanks.

    Hi Tany,
    As far as I understood, you need certain confirmation to proceed, isn't it? The simplest way is to redefine the commands and put some lisp routines in place. For example, the erase command below requires a confirmation from the user, and when you press Yes only it will erase the objects. I hope somebody may come up with reactor options.

    Code:

    (command "undefine" "erase") (defun c:erase (/ eObj nObj eCnf)   (setq eObj (ssget))   (if eObj 	(progn 	  (setq nObj (sslength eObj)) 	  (initget "Yes No") 	  (setq eCnf (getkword (strcat (rtos nObj 2 0) " object(s) found. Proceed [Yes/No]?: "))) 	  (if (= eCnf "Yes")  (command ".erase" eObj "")  (princ "\nObjects retained.")  ) 	  ) 	)   (princ)   )
    Regards

  3. #3

    Default Re: Run a LISP command after pressing ENTER or right-click in AutoCAD

    Interesting idea. Sometimes I wish that when I hit "L" for line, I do not
    have to hit enter. I was using the free google sketchup software and like
    how it automatically runs commands.

    Is there a way to set up quick keys that would not require the user
    to press enter? This would be the opposite of the original post.


  4. #4

    Default Re: Run a LISP command after pressing ENTER or right-click in AutoCAD

    Quote Originally Posted by Robert.Hall

    Interesting idea. Sometimes I wish that when I hit "L" for line, I do not
    have to hit enter. I was using the free google sketchup software and like
    how it automatically runs commands.

    Is there a way to set up quick keys that would not require the user
    to press enter? This would be the opposite of the original post.

    It could be done, but then you would remove the ability to do two keystroke commands like "li" for list. My best suggestion, get a nostromo n52, and you can program away until your heart is content with one stroke commands... Check here for ideas, they are relatively cheap, even if you have to buy it on your own dime. If so then write it off on your taxes the following year.

  5. #5

    Default Re: Run a LISP command after pressing ENTER or right-click in AutoCAD

    The autolisp command GRREAD allows keyboard and mouse monitoring.

  6. #6

    Default Re: Run a LISP command after pressing ENTER or right-click in AutoCAD

    I thought those were more for gaming than anything else?

    I can see your point for 2 keystroke commands. I would
    require a device that gives the computer a few extra keys.
    Too bad I couldn't just buy a 2 dollar number pad and get
    it to work. Cheaper than your suggestion.


  7. #7

    Default Re: Run a LISP command after pressing ENTER or right-click in AutoCAD

    Quote Originally Posted by Robert.Hall

    I thought those were more for gaming than anything else?

    I can see your point for 2 keystroke commands. I would
    require a device that gives the computer a few extra keys.
    Too bad I couldn't just buy a 2 dollar number pad and get
    it to work. Cheaper than your suggestion.

    Yeah but 104 programmable buttons. My left hand feels lonely when I CAD at home without it... The nostromo cant be beat, for what it does, also it is a perfect fit for most peoples hands. The panning on it isnt very good though.

  8. #8

    Default Re: Run a LISP command after pressing ENTER or right-click in AutoCAD

    Quote Originally Posted by marklabell

    Yeah but 104 programmable buttons. My left hand feels lonely when I CAD at home without it... The nostromo cant be beat, for what it does, also it is a perfect fit for most peoples hands. The panning on it isnt very good though.

    Instead of hijacking I posted to the original thread.

  9. #9

    tany0070 is offline

    100 Club


    Default Re: Run a LISP command after pressing ENTER or right-click in AutoCAD

    oh while we're at this topic anyone know how to modify a code so that it does not return an error when esc is pressed??

  10. #10

    Default Re: Run a LISP command after pressing ENTER or right-click in AutoCAD

    The *ERROR* autolisp function controls error out put. "*Cancel*" will display though.

whitsonmysecutage.blogspot.com

Source: https://forums.augi.com/showthread.php?58175-Run-a-LISP-command-after-pressing-ENTER-or-right-click-in-AutoCAD

0 Response to "Lisp Ask User to Press Enter Before Continuing"

Publicar un comentario

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel