What am I doing wrong? I am trying to add a reactor to activate Lee Mac's Popup subfunction with the qsave and save commands to alert user once a day when commands are activated, but unable to get it to work.
Any ideas would be much appreciated. Please see code below:
;;-------------------------=={ Popup }==----------------------;;
;; ;;
;; Displays a pop-up message box prompting the user. ;;
;;------------------------------------------------------------;;
;; Author: Lee Mac, Copyright © 2012 - www.lee-mac.com ;;
;;------------------------------------------------------------;;
;; Arguments: ;;
;; title - Text to be displayed in the pop-up title bar ;;
;; msg - Text content of the pop-up message box ;;
;; flags - Integer indicating icon & button appearance ;;
;; Reference: http://lee-mac.com/popup.html ;;
;;------------------------------------------------------------;;
;; Returns: Integer indicating the button pressed to exit ;;
;;------------------------------------------------------------;;
;;Reactor added by Robbo 2014-03-04
;;------------------------------------------------------------;;
(defun LM:Popup (callling-reactor
commandwillstart_list)
(alert
(car commandwillstart_list ))
(if (member (car commandwillstart_list)'("QSAVE" "SAVE"))
(progn
;;------------------------------------------------------------;;
(defun LM:Popup ( title msg flags / wsh res )
(if (setq wsh (vlax-create-object "wscript.shell"))
(progn
(setq res (vl-catch-all-apply 'vlax-invoke-method (list wsh 'popup msg
0 title flags)))
(vlax-release-object wsh)
(if (null (vl-catch-all-error-p res))
res
)
)
)
)
(defun IWillOnlyRunOnceADay nil
;;------------------------------------------------------------;;
;;Popup text added by Robbo 2014-03-04
;;------------------------------------------------------------;;
(LM:Popup ".bak file Information" "Please Note. To avoid project directory
clutter, .bak files are saved in your C:\\Temp_Acad\\Backup directory\n \nYou
may notice the benign error '_qsave Unable to transmit selected drawing
file.'\nThis is just a notification stating the .bak file wasn't saved in the
'expected' location - nothing to worry about!" (+ 0 64 4096))
(princ)
)
(if
(not
(and
(setq date (getenv "LMAC_OnceADay"))
(= (fix (getvar 'DATE)) (atoi date))
)
)
(progn
(IWillOnlyRunOnceADay)
(setenv "LMAC_OnceADay" (itoa (fix (getvar 'DATE))))
)
)
(princ)
)
)
)
Many thanks in advance, Robbo.