Notifications
Clear all

[Closed] Get size of viewport in world units?

I’m trying to work out how to get the width of a viewport in world units. Specifically orthographic views like Top, Front, Left.

This seems to get me the closest…
(gw.getVPWorldWidth [0,0,0]) * pi

But can’t work out why I’d need to multiply the value from the function by pi to make it close?

3 Replies

how does this work for you

vpsize = getViewSize();
 gw.getVPWorldWidth [0,0,0] * vpsize.x/vpsize.y;

This might return more accurate values for Portrait viewports, for example #layout_2v.

gw.getCPDisp [0,0,0] [1,0,0] [0,0] (getViewSize())

Cheers guys, both work!