Size of current view in Model

Size of current view in Model

J-Rocks
Collaborator Collaborator
990 Views
5 Replies
Message 1 of 6

Size of current view in Model

J-Rocks
Collaborator
Collaborator

Hello,

I am trying to get the size of current view in Model space but it seems unavailable in System variable settings.

There are Screensize, Viewsize, but they don't seem to be helpful.

 

Thank you

 

0 Likes
Accepted solutions (1)
991 Views
5 Replies
Replies (5)
Message 2 of 6

devitg
Advisor
Advisor

VSMAX  VSMIN 

 

 

0 Likes
Message 3 of 6

J-Rocks
Collaborator
Collaborator

@devitg wrote:

VSMAX  VSMIN 

 

 


No quite right and  that is too far from current screen limits.

0 Likes
Message 4 of 6

devitg
Advisor
Advisor

Mine bad , sorry 

 

0 Likes
Message 5 of 6

CodeDing
Advisor
Advisor
Accepted solution

@J-Rocks ,

 

You can use these 2 for Height & Width:

(setq h (getvar 'VIEWSIZE))
(setq w (* h (apply '/ (getvar 'SCREENSIZE))))

Or you can use this for Lower Left (LL) and Upper Right (UR) of current view:

(defun View:LL-UR ( / h w c)
  (setq h (getvar 'VIEWSIZE))
  (setq w (* 0.5 (* h (apply '/ (getvar 'SCREENSIZE)))))
  (setq h (* 0.5 h))
  (setq c (getvar 'VIEWCTR))
  (list
    (mapcar '- c (list w h))
    (mapcar '+ c (list w h))
  );list
);defun

 

Best,

~DD

0 Likes
Message 6 of 6

J-Rocks
Collaborator
Collaborator

@CodeDing Thank you, that's exactly what I wanted.

0 Likes