Hi guys, heres the thing:
I've recently wrote some subfunction to change the zoom(focus) on a list of graphical objects, that is being used along with grread (thats my #main).
So it utilises the following subfunction:
; Zooms on and highlights using grdraw / grvecs in order to focus on the target object
; (FocusOnObj (vlax-ename->vla-object (car (entsel))) 0.9)
(defun FocusOnObj ( o zv / cad ll ur ul lr L )
(cond
( (not (eq 'VLA-OBJECT (type o))) nil)
( (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-GetBoundingBox (list o 'll 'ur))))
(setq cad (vlax-get-acad-object))
(vla-ZoomWindow cad ll ur)
(vla-ZoomScaled cad (cond (zv)(1)) acZoomScaledRelative)
(mapcar 'set '(ll ur) (mapcar 'vlax-safearray->list (list ll ur)))
(setq ll (list (car ll) (cadr ll)))
(setq ur (list (car ur) (cadr ur)))
(setq ul (list (car ur) (cadr ll)))
(setq lr (list (car ll) (cadr ur)))
(setq L (list (list ll ul) (list ul ur) (list ur lr) (list lr ll) ))
(grvecs (apply 'append (mapcar '(lambda (x) (cons 1 x)) L)))
; (mapcar '(lambda (x) (apply 'grdraw (append x (list 1 3)))) L)
)
)
); defun FocusOnObj
However at the very begining I would like to initially store the zoom coordinates so in the end I could reset with:
(vla-ZoomWindow cad ll ur)
So any ideas how I could obtain them from the current zoom?
Alternatively I could make a counter that would count how many times I'd have to invoke the ZoomPrevious method, but IMO thats relatively ineffective approach.