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:
I did not find anything here:

Would 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])

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.

– Dale