Get Render mesh from objects in Grasshopper

Hi everyone,

How can I get the render mesh from objects in Grasshopper? I want to avoid using ExtractRenderMesh command in rhino for non-destructive workflow.

I tried to use python for it, but no luck. Documentation is also to difficult for me to understand. I would prefer to use GUIDs as input (I use ā€œGā€ in script). See here:

import Rhino

self = list()

ids = Rhino.DocObjects.Tables.ObjectTable.Select(self,G)
m = Rhino.DocObjects.RhinoObject.GetRenderMeshes(ids, True, False)

import Rhino
rhobjs = []
for id in guids:
    rhobjs.append(Rhino.RhinoDoc.ActiveDoc.Objects.FindId(id))
a = []
for objref in Rhino.DocObjects.RhinoObject.GetRenderMeshes(rhobjs, True, True):
    a.append(objref.Mesh())

List Comprehension:

import Rhino
rhobjs = [Rhino.RhinoDoc.ActiveDoc.Objects.FindId(id) for id in guids]
a = [objref.Mesh() for objref in Rhino.DocObjects.RhinoObject.GetRenderMeshes(rhobjs, True, True)]

GetRenderMeshes.gh (1.6 KB)

1 Like

Nice! Thank you so much!