TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: efernal on December 23, 2008, 07:54:23 AM

Title: how to get model space screen size in pixels?
Post by: efernal on December 23, 2008, 07:54:23 AM
I can know the screen size (in drawing units) with VIEWCTR system var...
But how to know the model space screen size in pixels, with plain auto lisp?
Is there a way?
This is necessary to calculate the size for export with .bmp format (command EXPORT)
Thanks in advance...

e.fernal
Title: Re: how to get model space screen size in pixels?
Post by: Spike Wilbury on December 23, 2008, 09:57:21 AM
Here are two functions (forgot the author) might help.-

Code: [Select]
  ;;; Conversion pixel to drawing units
  (defun PIX2UNITS (pix)
    (* pix (/ (getvar "VIEWSIZE") (cadr (getvar "SCREENSIZE")))))

  ;;; Conversion drawing units to pixel
  (defun UNITS2PIX (units)
    (* units (/ (cadr (getvar "SCREENSIZE"))(getvar "VIEWSIZE"))))
Title: Re: how to get model space screen size in pixels?
Post by: efernal on December 23, 2008, 10:32:51 AM
Thanks, Le...
e.fernal