Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Mentor
alanjt_
Posts: 483
Registered: ‎08-25-2008
Message 11 of 15 (171 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,262
Registered: ‎12-29-2009
Message 12 of 15 (165 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: 483
Registered: ‎08-25-2008
Message 13 of 15 (163 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,262
Registered: ‎12-29-2009
Message 14 of 15 (157 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: 483
Registered: ‎08-25-2008
Message 15 of 15 (155 Views)

Re: Purge on Exit

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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!