I’ve done a little Grasshopper program for calculating position and spacing for linear array things. I’ve used it quite a lot. Lately, I had a chance to try it when I’ve set a CPlane at an angle, and realized that it didn’t work. I realized this was because my direction vector for the array linear component was incorrect because of the different CPlane, but could find no way to get the information about the plane so I could use it to fix the issue.
So, is there a way to grab the information about a CPlane? I’ve looked through the Grasshopper components and could not find anything. I haven’t looked in the Rhino API yet. Does anyone know? I have a workaround where I can create a surface in the CPlane and use a Grasshopper EvaluateSrf component, but I’d rather get the CPlane parameters directly if possible.
Moved to Grasshopper category
Have you tried DECONSTRUCT PLANE?
deconstruct plane would be nice if you could get the CPlane. Deconstruct Plane comes up set to WorldXY, but when I try to set it to my CPlane by setting the X and Y directions, the deconstruct component calls it a null plane and still outputs the 0,0,1 ; 0,1,0 ; and 0,0,1 . If I use my surface I created as a proxy for the CPlane and input that to the deconstruct plane component then I get the outputs I expect. But this is no better than what I did before with EvaluateSrf. I need a way to grab the CPlane direction vectors. They must exist in Rhino somewhere.
The only thing I’ve found in the API so far is
var myP = Rhino.ApplicationSettings.ViewSettings.GetCurrentState();
myP.DefinedViewSetCPlane
but I don’t really want to set the CPlane from Grasshopper. I want to know the parameters of the CPlane I have already set. I realize this must be for a particular view so somehow I have to specify that.
I kept searching and finally found something that works. So here it is in a Grasshopper C# script component, in case anybody else needs it.
Rhino.Display.RhinoView view = this.RhinoDocument.Views.ActiveView;
Rhino.DocObjects.ConstructionPlane cplane = view.ActiveViewport.GetConstructionPlane();
a = cplane.Plane;