Hello does anyone know about some C# or python script which allows to control a clipping plane with a plane. I know about referencing clipping planes as guides and have found some older C# scripts which should work but arent for me. got a error message which poped up infinitly so I had to say show no more which is why i cant post it here (forgot to copy). but as far as i remember it said something about a part of the script being outdated
this is the code
var cp = new Rhino.DocObjects.ObjRef(id);
var source = cp.ClippingPlaneSurface().Plane;
RhinoDoc.ActiveDoc.Objects.Transform(id, Transform.PlaneToPlane(source, pl), true);
Ah right, of course you need access directly to ActiveDoc because Grasshopper.
This script works:
__author__ = "jesterking"
import Rhino
# create an ObjRef
_cp = Rhino.DocObjects.ObjRef(cp)
# get the Plane out from the clipping plane
_cppl = _cp.ClippingPlaneSurface().Plane
# now transform the clipping plane by passing its GUID
# and a new transform that is created from the clipping
# plane to the new plane
Rhino.RhinoDoc.ActiveDoc.Objects.Transform(
cp,
Rhino.Geometry.Transform.PlaneToPlane(
_cppl,
plane
),
True
)
Is there an easy way to dynamicaly create guides / clipping planes along with the input planes ?
Im thinking about iterative processes with different counts of clipping planes