Grasshopper

algorithmic modeling for Rhino

Create/Delete/ Set Viewport for Clipping Planes in GH Python..

Hi Everyone,

I have been working on creating a code to make clipping planes in GH Python but have come unstuck 

 

1. How to define the named viewport the clipping plane should be active and not have it set to the active viewport. I have been able to find the Viewport ID for all the viewports but not just select by name then extract the ID and use it in the clipping plane code below. This is current code, (not included broken broken experiments)

import rhinoscriptsyntax as rs

import scriptcontext as sc

import Rhino

 

sc.doc = Rhino.RhinoDoc.ActiveDoc

 

# Get the active view

view = scriptcontext.doc.Views.ActiveView

 

# Add a clipping plane object to the document

Clipping_Plane = sc.doc.Objects.AddClippingPlane(P, 1, 1,view.ActiveViewportID)

2. How would i get the GUID of this Clipping plane and use it to delete itself before the script is run again and the new one is created so i don't end up loads of clipping planes. I have been able to do it using selclipping plane and delete scripted from the command line but would rather have everything done in the code where possible.

 

Thanks matt

 

Views: 1802

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service