Lisp Ask User to Press Enter Before Continuing
-
2007-03-29,04:10 AM #1
100 Club
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.
-
2007-03-29,10:38 AM #2
I could stop if I wanted to
Re: Run a LISP command after pressing ENTER or right-click in AutoCAD
Originally Posted by tany0070
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) )
-
2007-03-29,12:22 PM #3
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.
-
2007-03-29,01:10 PM #4
Re: Run a LISP command after pressing ENTER or right-click in AutoCAD
Originally Posted by Robert.Hall
-
2007-03-29,05:17 PM #5
Re: Run a LISP command after pressing ENTER or right-click in AutoCAD
The autolisp command GRREAD allows keyboard and mouse monitoring.
-
2007-03-29,08:44 PM #6
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.
-
2007-03-29,08:51 PM #7
Re: Run a LISP command after pressing ENTER or right-click in AutoCAD
Originally Posted by Robert.Hall
-
2007-03-29,10:16 PM #8
Re: Run a LISP command after pressing ENTER or right-click in AutoCAD
Originally Posted by marklabell
-
2007-03-30,01:59 AM #9
100 Club
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??
-
2007-03-30,02:57 AM #10
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