Views vs viewports : How do they work, and what's their difference?

namedview

(Binigya) #1

Hi,
I was using Rhino 6, and I found out that there are 4 pre-defined viewports (Top, Right, Front, perspective).

Is it possible to add custom viewports?

Do I need to use NamedViews for that? How are NamedViews different from the viewports?

Also, how can I get access to the existing Viewports in the document? (I know I would have to use the CRhinoViewIterator, but am unclear regarding how to do that)

And finally, there are also views in Rhino. What are they and how do they differ from the viewports themselves?

Thanks!


#2

view
https://apidocs.co/apps/rhinocommon/6/T_Rhino_Display_RhinoView.htm
viewport
https://apidocs.co/apps/rhinocommon/6/T_Rhino_Display_RhinoViewport.htm
The properties and methods kinda tell me what they are and why they are different. Hope it helps you too.


(Alex) #3

Hey @Will_Wang,

Thank you for the help!

So, I went through the links, and from what I gather, a View contains many viewports and viewports are just used to contain viewports.

And, viewports are like “cameras” that have different perspectives on how to “see” objects.

If you have the time, I would like to know if I got it right, or should I refer to the docs one more time.

Do let me know!


(Binigya) #4

Thanks !


(Steve Baer) #5

There is typically a one to one ratio between a view and a viewport with the exception of layouts. A layout view has a top level viewport and zero or more nested viewports (details).


(Binigya) #6

Thanks for the clarification @stevebaer. And, if I understand it correctly, a named view is a custom viewport, right?


(Steve Baer) #7

I believe so. It probably should have technically been called a named viewport, but that ship has sailed.