Lee Mac 发表于 2022-7-6 12:55:37

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))

ollie 发表于 2022-7-6 12:59:49

Hehe I wrote a similar script recently but with a group of light hearted (alert insults)

ReMark 发表于 2022-7-6 13:05:09

Lee: Run out of challenges or just feeling a little bored?

flowerrobot 发表于 2022-7-6 13:05:59

Mmmm makes me want to place not in that eq function, and load it on people's computers

fuccaro 发表于 2022-7-6 13:10:59

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

Lee Mac 发表于 2022-7-6 13:12:33

 
Bit of both really

Lee Mac 发表于 2022-7-6 13:16:32

 
Haha, nice one!

flowerrobot 发表于 2022-7-6 13:18:42

 
I like this idear!

Lee Mac 发表于 2022-7-6 13:23:14

Some good ones here:
 
http://www.cadtutor.net/forum/showthread.php?t=33388

Lee Mac 发表于 2022-7-6 13:25:35

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
查看完整版本: Another Pointless Program :P