Get Pageview size


To create a pageview I do:

pageview = doc.Views.AddPageView(“MyPage”, _pageSize.Width, _pageSize.Height);

How I can get the page view Width and Height again from the pageview object?



Funny, I was looking into exactly teh same thing yesterday!

I think that this is not (yet) in RhinoCommon. In C++ you can call void GetPaperSize(ON::unit_system units, double& width, double& height) const; on a PageView. We could ask @stevebaer to add this to RhinoCommon :smile:

But: if you create the view yourself, you could save the size for later use maybe? This is what I ended up doing.

Hi Menno,

Thanks for your answer. The problem is I need to save in the doc this info to use it in the future.



Maybe you can use SetDocumentUserText?

Or use PlugIn.WriteDocument and PlugIn.ReadDocument to write/read plug-in data.

Be sure to implement PlugIn.ShouldCallWriteDocument too!

RhinoPageView.PageWidth and RhinoPageView.PageHeight properties are available in RhinoCommon in SR10