I wonder has anyone solved this trivial problem... Suppose we have hundreds of DWGs not zoomed properly after last saved session... I know ObjectDBX can't help, but I am seeking for the fastest solution like ODBX... Have anyone from ADESK thought ab this... This problem dates from 2005...
All I have is not working ODBX code
(defun c:odbx-zoom-extents ( / *error* getfiles fullfilenames odbx )
(vl-load-com)
(defun *error* ( msg )
(if (and odbx (not (vlax-object-released-p odbx)))
(vlax-release-object odbx)
)
(if msg (prompt msg))
(princ)
)
(defun getfiles ( path / dirs files )
(setq path (strcat path "\\"))
(setq dirs (vl-directory-files path nil -1))
(setq dirs (vl-remove "." dirs))
(setq dirs (vl-remove ".." dirs))
(setq files (vl-directory-files path "*.dwg" 1))
(setq fullfilenames (append fullfilenames (mapcar '(lambda ( x ) (strcat path x)) files)))
(mapcar '(lambda ( x ) (getfiles (strcat path x))) dirs)
fullfilenames
)
(setq fullfilenames (getfiles (vl-filename-directory (getfiled "Select main directory" "" "" 4))))
(setq odbx (vla-getinterfaceobject (vlax-get-acad-object) (strcat "ObjectDBX.AxDbDocument." (itoa (atoi (getvar 'acadver))))))
(foreach file fullfilenames
(vla-open odbx file)
(vla-zoomextents (vla-get-application odbx))
(vla-saveas odbx file)
)
(*error* nil)
(princ)
)
Kind regards, M.R.