Hi @clement,
I think scripting the ChangeSpace
command is your best option in Rhino 5.
Rhino 6 has has new DetailViewObject.WorldToPageTransform and DetailViewObject.PageToWorldTransform properties which provide the necessary transforms.
If you want to run your code through RhinoScript, you can use XformWorldToLayout and
XFormLayoutToWorld```.
– Dale