R2005: I'm trying to load and run an Autolisp file when the save button is pressed on a couple of AutoCAD installations. Is that possible? Here's what I'm trying and can't get it to work. Code: ;;01/28/05 Bill Zondlo ;;Program to have lisp execute on save. ;-----; (load "g:/autolisp/subr/r2d2") ;-----; (defun ExeSubr () (r2d2) ) ;-----; (defun SaveDwg2WOL (/ Save2WOL) (vl-load-com) (if (vlr-reactors :vlr-object-reactor) (vlr-remove-all) ) ;;; (setq Save2WOL (vlr-dwg-reactor nil '((:vlr-saveComplete . ExeSubr) ) ) ) (princ) ) TIA Bill
Oh, By the way, I'm loading and runnig this from my .mnl file. Or do I need to load and run this on each drawing opened? Bill
This is the erro I keep gettting: Command: _qsave ; error: too many arguments ; error: too many arguments ; error: too many arguments Bill
Bill, give this a try: (defun ExeSubr (reactor params) (r2d2)) (defun SaveDwg2WOL () (vl-load-com) (if (not Save2WOL) (setq Save2WOL (vlr-dwg-reactor nil '(vlr-saveComplete . ExeSubr))))) (princ))
Thanks All, I guess I stripped the example, that I got on another sight, down a little too far. :^) Always something new to learn. Bill