Hi all, does anyone was able to set the plane of a view withing GH. I tried with a basic definition in Python, it works but it freezes grasshopper once completed. I attached the definition, thanks in advance.
import rhinoscriptsyntax as rs
if x :
sc.doc = rc.RhinoDoc.ActiveDoc
rs.CurrentView
rs.Command(“_cplane view”)
sc.doc = ghdoc
//CS
private void RunScript(bool reset, ref object A)
{
if (!reset) return;
var vp = RhinoDocument.Views.ActiveView.ActiveViewport;
var origin = vp.CameraTarget;
var xDir = vp.CameraX;
var yDir = vp.CameraY;
var pl = new Plane(origin, xDir, yDir);
vp.SetConstructionPlane(pl);
}
hi @Mahdiyar awesome! if Iam in a “Perspective View” after define a CPlane with SetConstructionPlane method, I’d like to save this view with a “name”, how can I do it?
Then I’d like to return to my initial plane settings of my “Perspective View”? Please, any help will be appreciated, thanks!
T.