How to duplicate a Layout (PageView in RhinoCommon)?

How can I duplicate a Layout (PageView in RhinoCommon) via Python or Rhinocommon?
I am looking for a command that is similar to this UI function:
2018-07-04_120015
I did not find anything here:
https://developer.rhino3d.com/api/RhinoCommon/html/T_Rhino_DocObjects_Tables_ViewTable.htm

Would https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Display_RhinoPageView_Duplicate.htm work for you?

I thought this one just duplicates the object in memory. does it actually add a new tab to the UI ?

Ah right, that I don’t know. Hopefully @dale or @pascal have the answers to that.

import rhinoscriptsyntax as rs
import scriptcontext as sc

vns = rs.ViewNames(return_names=False,view_type=1)
viewObj = sc.doc.Views.Find(vns[0])
viewObj.Duplicate(True)

fails with:
Message: 'RhinoPageView' object has no attribute 'Duplicate'

Hi @Goswin,

The RhinoPageView.Duplicate is in Rhino 6. Are you using this version?

– Dale

@dale I think there is a bug in RhinoPageView.Duplicate(True)
It creates a new Layout and duplicates the geometry, but the duplicated geometry stays on the previous Layout. the new layout remains empty. The old layout has duplicate geometry. Can you reproduce this using my above pythonscript?

I am on Rhino 6, 6.6.18177.16151

Hi @Goswin,

I am able to repeat this bug - looks like an easy fix.

https://mcneel.myjetbrains.com/youtrack/issue/RH-47249

– Dale