Another Pointless Program :P
Maybe a bit of fun for a co-worker...Will beep upon invoking the Explode command
(defun c:ExOn () (vl-load-com) (if (not *exR) (setq *exR (vlr-command-reactor nil (list (cons :vlr-commandWillStart 'Beep!)))))(princ))(defun Beep! (Reac Args) (if (eq "EXPLODE" (strcase (car Args))) (vlr-beep-reaction nil)) (princ))(defun c:ExOff () (if (and *exR (vlr-added-p *exR)) (progn (vlr-remove *exR) (setq *exR nil))) (princ)) Hehe I wrote a similar script recently but with a group of light hearted (alert insults) Lee: Run out of challenges or just feeling a little bored? Mmmm makes me want to place not in that eq function, and load it on people's computers Once I redefined the Explode command on my colleague's computer. When he tried to explode dimensions or hatches, an allert box announced him that it is not a good drawing practice. The funny side: even today, he thinks that it is an AutoCAD built-in message
Bit of both really
Haha, nice one!
I like this idear! Some good ones here:
http://www.cadtutor.net/forum/showthread.php?t=33388 Even Better!
(defun c:ExOn () (vl-load-com) (if (not *prank) (setq *prank (vlr-command-reactor nil (list (cons :vlr-commandWillStart 'prank) (cons :vlr-commandEnded 'notAmused) (cons :vlr-commandCancelled 'notAmused))))) (princ))(defun prank (Reac Args) (if (eq "EXPLODE" (strcase (car Args))) (vlax-for Obj (vla-get-block (vla-get-ActiveLayout (vla-get-ActiveDocument (vlax-get-acad-object)))) (vla-put-visible Obj :vlax-false))) (princ))(defun notAmused (Reac Args) (if (eq "EXPLODE" (strcase (car Args))) (vlax-for Obj (vla-get-block (vla-get-ActiveLayout (vla-get-ActiveDocument (vlax-get-acad-object)))) (vla-put-visible Obj :vlax-true))) (princ))(defun c:ExOff () (if (and *prank (vlr-added-p *prank)) (progn (vlr-remove *prank) (setq *prank nil))) (princ))
页:
[1]
2