Originally Posted by
chrisw.94380
I've been trying to look for a timing command. Something that would run the commad "unloadcd" after a certain period of time. Also how do I get the lisp to run when a civil design command is ran. I know now that I just want this command to run as soon as a civil design command is used and if one isn't used within 10 minutes then it will unload civil design.
Try searching this forum for Auto save, Peter posted a code that performs an auto save every 10 minutes, you can probably use this for a jumping off point
Code:
(setq sngCdate (atof
(substr
(rtos
(variant-value
(vla-getvariable
(vla-get-activedocument
(vlax-get-acad-object)
)
"cdate"
)
)
2
4
)
1
)
)
)
(if sngCdateOld
(if (or (>= (- sngCdate sngCdateOld) 0.0010); this is the line that determines 10 minues .0001 is 1 minute and .01 is an hour
(< (- sngCdate sngCdateOld) 0.0)
)