Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Python script that changes geometry of objects in document

$
0
0

Hello,
I am trying in grasshopper to select all the meshes in the Rhino document and check if they are not closed, so that I close them using Rhino.Geometry.Mesh.FillHoles(), the script below runs without errors, but the open meshes in viewport remain open.

import rhinoscriptsyntax as rs
import scriptcontext as sc
import os
import Rhino

sc.doc = Rhino.RhinoDoc.ActiveDoc

for rObj in Rhino.RhinoDoc.ActiveDoc.Objects:
    if(rObj.ObjectType == Rhino.DocObjects.ObjectType.Mesh):
        mesh = rObj.Geometry
        if mesh.IsClosed == False:
            Rhino.Geometry.Mesh.FillHoles(mesh)
            
sc.doc = ghdoc

3 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles