Enable/Disable clipping planes

rhinocommon
unhandled

(N Leguina) #1

Hi

I’m fairly new to coding in rhino

I am trying to control the views which are affected by clipping planes from withing a GH file in the c# component.

I can seem to access the enable pat of the clipping plane.
I don’t know where to call it from

it seems to live in the display pipeline

Here

but when I try this:

Rhino.DocObjects.ObjRef obj = new Rhino.DocObjects.ObjRef(id);
Rhino.DocObjects.ClippingPlaneObject cpObj = obj.Object() as Rhino.DocObjects.ClippingPlaneObject;
 Rhino.Display.DisplayPipeline.EnableClippingPlanes(true);

it throws this error:

  1. Error (CS0120): An object reference is required for the non-static field, method, or property ‘Rhino.Display.DisplayPipeline.EnableClippingPlanes(bool)’ (line 80)

if I try to add the clipping plane inside the parenthesis next to the true it tells me it only takes one argument

I don’t know how to access the enable in side the plane

Any help would be much appreciated

Thanks in advance


(Dale Fugier) #2

Hi @n.leguina,

To “disable” a clipping plane object, you need to modify the object by removing the viewport id (or ids) that you want the object to no longer clip.

Does this help?

– Dale


(N Leguina) #3

Hi Dale

Thanks for the pointer

what I want to do is add a view port id to the list that the plane is clipping, but I cant seem to find where this list lives inside the clipping plane class.

I can access attributes, geometry, etc… But not the list of views being clipped.

Do you know where they live.

Thanks for your help


(Dale Fugier) #4

Hi @n.leguina,

Look here:

http://developer.rhino3d.com/api/RhinoCommon/html/P_Rhino_Render_ChangeQueue_ClippingPlane_ViewIds.htm

http://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_DocObjects_ClippingPlaneObject_RemoveClipViewport.htm

– Dale


(N Leguina) #5

Thank you very much

I have looked at that

I just don’t know how to call it

it doesn’t seem to be withing the clipping plane

When I write this:

Rhino.DocObjects.ObjRef obj = new Rhino.DocObjects.ObjRef(id);
Rhino.DocObjects.ClippingPlaneObject cpObj = obj.Object() as Rhino.DocObjects.ClippingPlaneObject;
A = cpObj.ViewsIds;

I get this error.

. Error (CS1061): ‘Rhino.DocObjects.ClippingPlaneObject’ does not contain a definition for ‘ViewsIds’ and no extension method ‘ViewsIds’ accepting a first argument of type ‘Rhino.DocObjects.ClippingPlaneObject’ could be found (are you missing a using directive or an assembly reference?) (line 73)

So I’m still not finding where this views live

Cant seem to find it within the plane, maybe they’re are stored somewhere else.

I tried to access them though the Rhino.Render.ChangeQueue namespace

But now luck either.

Thanks again


(N Leguina) #6

Mybe this is the clue

http://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_DocObjects_ClippingPlaneObject_AddClipViewport.htm

But again i don’t know how to call the method. It doesn’t seem to be from the plane, but from somewhere else.

Thanks for you time Dale.