But the reactor would need some form of GrRead loop to track the mouse movements - which, combined with a reactor, may cause trouble I defer to your genius Lee... can you incorporate this?
(setq SpV (vlax-create-object "Sapi.SpVoice")) (vlax-invoke SpV "Speak" "Kaboom" 0) (vlax-release-object SpV) I'm no genius Larry
(defun c:ExOn () (vl-load-com) (if (not *prank) (setq *prank (vlr-command-reactor nil (list (cons :vlr-commandWillStart 'prank))))) (princ))(defun prank (Reac Args) (if (eq "EXPLODE" (strcase (car Args))) (progn (setq SpV (vlax-create-object "Sapi.SpVoice")) (vlax-invoke SpV "Speak" "Kaboom" 0) (vlax-release-object SpV))) (princ))(defun c:ExOff () (if (and *prank (vlr-added-p *prank)) (progn (vlr-remove *prank) (setq *prank nil))) (princ)) Ha! now it's truly pointless
Not really... reminded me how reactors work- Thx No probs - Its a fun program And what if the user selects the objects *before* it starts the Explode command? Lee
Since you once offered to explain your stuff...
how about this?
(defun c:ExOff () (if (and *exR (vlr-added-p *exR)) (progn (vlr-remove *exR)(setq *exR nil)))I've read Help about vlr-added-p, but how is *exR 'made' a VLR object representing the reactor? I use the variable *exR as a global variable (not localised in any function), and bound the reactor object to it, when the user invokes the top program (ExON).
EDIT!
OOPs!Forgot to change it from the last program!
**program updated above... nice spot Larry! Oh, OK... Thx
页:
1
[2]