std-zoom-if, std-zoom-if-apply, std-zoom-extents


Synopsis

(std-zoom-if <pt1> <pt2>) ; ZOOM Window if box invisible

(std-zoom-if-apply <pt1> <pt2> <func>) ; apply func if box invisible

(std-zoom-extents) ; transparent ZOOM Extents if necessary

Description

STD-ZOOM-IF calls the command "_ZOOM" "_Window" pt1 pt2 if one of the points pt1 or pt2 is not visible on the screen. If the actual ZOOM region is larger do nothing. This is used to force the visibility a certain window region, which is required on graphics based selections or operations.

STD-ZOOM-IF-APPLY calls a user-defined function with two arguments suitable to (command "_ZOOM" _"Window" arg1 arg2). The two point arguments are the extrema of the given point arguments and the actual viewport.

STD-ZOOM-EXTENTS calls "_ZOOM" "_Extents" if not all entities are visible.

If the actual ZOOM region is larger do nothing.

If the actual viewport zoom is equal or larger in all four directions than the given extrema points do nothing. Of course you can always force a zoom command but these functions minimize the need to actually do this.

The points are interpreted in WCS.

Exceptional Situations

STD-ZOOM-IF will fail if a DCL dialog is active, but STD-ZOOM-EXTENTS will not fail if VLA is enabled. You can also try a customized STD-ZOOM-IF-APPLY function.

Note: In R14 the VLA Zoom Window functionality was broken.

Example

;;; see all choosen element

(setq eles (std-sslist (ssget)))
(std-zoom-if
  (apply 'std-xy-min (apply 'append (mapcar 'std-getpts eles)))
  (apply 'std-xy-max (apply 'append (mapcar 'std-getpts eles))))

;;; over-simplified STD-ZOOM-IF version

(std-zoom-if-apply minpt maxpt 
  (function (lambda (p1 p2) (command "'_Zoom" "_Window" p1 p2))))

(action_tile "See All" "(dcl-zoom-extents-action)")
(defun dcl-zoom-extents-action ()
  (std-zoom-extents))

Arguments

pt1, pt2: 2d or 3dpoints in WCS

func: Function expecting two point arguments

Return Value

Undefined.

Side Effects

Only.

It may call the command ZOOM which may require a REGEN.

Currently it is not specified if REGEN is forced or not, which would require an explicit (command "_Y").

Module

(std-require 'STDTBL)

Defined in STDTBL