Will someone please try this out and let me know if it works for them. I can't get it to work. I've followed The VisuaLisp's Developer's Bible and besides taking out the counting feature in Dave's rendition, I can't seem to figure out why I can't get it to work. Speaking of Dave, does anybody think he'd be interested in joining this board?
(defun c:zea ()
(vla-StartUndoMark (vla-get-activedocument (vlax-get-acad-object)))
;(deselect) not necessary
(setq $acad (vlax-get-acad-object)
alldocs (vla-get-documents $acad)
this (vla-get-activedocument $acad)
)
(defun ZoomExtents ()
(vla-put-ActiveDocument each);|<-Doesn't this pick up the object when it's run under vlax-for?|;
(vla-ZoomExtents $acad)
(vla-put-ActiveDocument this)
(vlax-release-object $acad)
(vlax-release-object alldocs)
)
(vlax-for each alldocs
(if (= (vla-get-ActiveSpace each) 0) ; If in paperspace
(cond
((and (= (vla-get-MSpace each) :vlax-True)
; in mspace viewport
(= (vla-get-DisplayLocked
(vla-Get-ActivePViewport each)
)
:vlax-True
) ; Mspace viewport is locked
)
(vla-put-MSpace each :vlax-False)
(ZoomExtents)
(vla-put-MSpace each :vlax-True)
)
((and (= (vla-get-MSpace each) :vlax-True)
; in mspace viewport
(= (vla-get-DisplayLocked
(vla-Get-ActivePViewport each)
)
:vlax-False
) ; Mspace viewport is not locked
)
(ZoomExtents)
)
((= (vla-get-MSpace each) :vlax-False)
(ZoomExtents)
)
)
(ZoomExtents)
)
)
(vla-EndUndoMark (vla-get-activedocument (vlax-get-acad-object)))
(princ)
)