std-pix->units, std-units->pix | ![]() |
Those two functions convert between AutoCAD drawing units (which are just "unitless" numbers) and pixel on the monitor, dependent on the graphics resolution and the size of the window and the view.
Pixel are used in object picks and selections.
For example you often need to select a element on a point relative 3 pixel to the right.
;;; find the next element to the right, not foolproof!
;;; it might not terminate.
(defun rightmost-element (pt / picksize new-pt pick) (setq picksize (std-pix->units (getvar "PICKBOX"))) (while (not (setq pick (ssget (setq new-pt (polar pt 0 picksize))))) (setq pt new-pt) ) pick )
pix: a positive integer number.
num: any number.
Any number.
None.
(std-require 'STDTBL)
Defined in STDTBL