I hate doing things I can make my computer do for me. My adventures in customizing and automating computers. Primarily with AutoCAD and Microsoft Office.

Monday, March 30, 2009

Close with save - all drawings except current

This will close all currently open drawings, saving those that have been modified since their last save.

(vlax-for doc (vla-get-documents(vlax-get-acad-object))
  (
if (doc (vla-get-activedocument(vlax-get-acad-object)))
    
nil
    
(progn
      
(if (or
        
((getvar "dbmod"))
        (
= :vlax-false (vla-get-readonly doc))
        )
    (
vl-catch-all-apply 'vla-close (list doc :vlax-false))
    (
vl-catch-all-apply 'vla-close (list doc :vlax-true))
    )
      )
    )
  )

No comments: