Encountering a Problem with Code for Outputting Lattice Mesh

Hello,

I’m encountering an issue with an attached STL file. When I input this STL file mesh into a Grasshopper component (I’ve also included the Grasshopper component I’m using), I’m able to get the desired lattice mesh as an output. However, when I try to achieve the same result using code (I’ve attached the code as well), I’m facing an issue. I cannot see the lattice mesh in the output parameter of the Grasshopper component when using code. How can I resolve this issue?

-Bhavita
Invalid1.stl (651.2 KB)
Lattice.gh (84.1 KB)

Hi Bhavita,

What are you inputting in the trees parameter?
As a first test, I would use Hops withing Grasshopper to check if the definition is ready to be used on Rhino.Compute.

Regards,
PC

Hello @pedrocortes,

Tree takes two input parameters: the first one is a mesh in STL file, and the second one is the offset distance.

Regards,
Bhavita

I mean how is this stl file being inputted… could you show it?

This is how I am extracting mesh from STL file.

Hi Bhavita,

When you call the Rhino.Open() method it returns a RhinoDoc which you should store in a variable.
var doc = RhinoDoc.Open(stlFileName, out bool t5);

Once done, you will be able to check the Objects property directly and seek the meshes you need to continue the process.

Regards,
PC