Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Mentor
alanjt_
Posts: 480
Registered: ‎08-25-2008
Message 11 of 15 (127 Views)

Re: Purge on Exit

01-11-2012 09:31 AM in reply to: Lee_Mac

So, what happens if the user is just opening a drawing to extract something, or look at something. No changes are made, but now it will be purged and saved with a new date.

*Expert Elite*
Lee_Mac
Posts: 1,168
Registered: ‎12-29-2009
Message 12 of 15 (121 Views)

Re: Purge on Exit

01-11-2012 10:19 AM in reply to: alanjt_

alanjt_ wrote:

So, what happens if the user is just opening a drawing to extract something, or look at something. No changes are made, but now it will be purged and saved with a new date.


Ok, to account for the remote possibility that DBMOD remains unchanged:

 

(vl-load-com)
(if (null *editor-reactor*)
    (setq *editor-reactor* (vlr-editor-reactor nil '((:vlr-beginclose . purgedwg))))
)
(defun purgedwg ( reactor params )
    (if (null *acdoc*)
        (setq *acdoc* (vla-get-activedocument (vlax-get-acad-object)))
    )
    (if
        (and
            (= 1 (getvar 'DWGTITLED))
            (= 0 (getvar 'DBMOD))
            (equal (getvar 'TDUPDATE) (getvar 'DATE) (/ 5.0 86400.))
        )
        (progn
            (repeat 3 (vla-purgeall *acdoc*))
            (vla-save *acdoc*)
        )
    )
    (princ)
)
(princ)

 

Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)
Expert Elite
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Valued Mentor
alanjt_
Posts: 480
Registered: ‎08-25-2008
Message 13 of 15 (119 Views)

Re: Purge on Exit

01-11-2012 10:22 AM in reply to: Lee_Mac

Far from a remote possibility.

 

Hell, open a set of drawings just for printing purposes, but users taking objects from one drawing (that remains unedited) is a normal occurance.

*Expert Elite*
Lee_Mac
Posts: 1,168
Registered: ‎12-29-2009
Message 14 of 15 (113 Views)

Re: Purge on Exit

01-11-2012 10:38 AM in reply to: alanjt_

Well anyway, its accounted for

Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)
Expert Elite
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Valued Mentor
alanjt_
Posts: 480
Registered: ‎08-25-2008
Message 15 of 15 (111 Views)

Re: Purge on Exit

01-11-2012 10:42 AM in reply to: Lee_Mac

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.