本帖最后由 菜卷鱼 于 2020-4-18 11:15 编辑
我们工程师每天都低着头画图,忙起来就没啥时间概念,每天都被文员催着报工作,所以就写了一个提醒他们报工作的小程序。
只要他们一输入命令,就会弹出要他们报工作的提示,
缺点:必须要在操作CAD,否则没办法提醒
如果有大神有更好的办法,能够不进行任何操作的情况下,就能弹出提醒,能告诉在下就好了。
 - (or *reportmyworkcmd*
- (setq *reportmyworkcmd*
- (vlr-command-reactor
- nil
- '(
- (:vlr-commandWillStart . reportmywork)
- ))))
- (defun reportmywork (x1 x2)
- (if (= (getenv "come_date") nil)
- (setenv "come_date" "20200418"))
- ;;;设置系统初次提醒日期
- (if (= (getenv "noti_time") nil)
- (setenv "noti_time" "1600"))
- ;;;设置系统初次提醒时间
- (if (= noti_time nil)
- (setq noti_time (atoi (getenv "noti_time")))) ;;;设置本地提醒时间
- (if (= come_date nil)
- (setq come_date (atoi (getenv "come_date")))) ;;;设置本地提醒日期
- (setq this_date (atoi (substr (rtos (* (getvar "cdate") 1e8)) 1 8)))
- (setq this_time (atoi (substr (rtos (* (getvar "cdate") 1e8)) 9 4)))
- (if (and (>= this_date come_date) (>= this_time noti_time))
- (progn (princ "\n**工作报了吗**\n**一分钟之后提醒你哦**\n**报了就输入命令:bl**")
- (setq noti_time (1+ this_time)))
- )
- )
- (defun c:bl nil
- (princ "\n**别啰嗦了,已经报了。")
- (princ "\n**[提示:设置报工作时间:bgzsj]。\n**[提示:设置报工作日期:bgzrq]。")
- (setenv "come_date" (itoa (1+ this_date)))
- (princ "\n**哦,我知道了。")
- (prin1)
- )
- (defun c:bgzsj nil
- (prinx "时间格式:" (getenv "noti_time"))
- (setenv "noti_time" (getstring "\n设置提醒报工作时间:"))
- (prin1)
- )
- (defun c:bgzrq nil
- (prinx "日期格式:" (getenv "come_date"))
- (setenv "come_date" (getstring "\n设置提醒报工作日期:"))
- (prin1)
- )
|