<div dir="ltr">Hi Ricardo,<div><br></div><div>The code you sent in your email should work fine if "trianglePolyData" is a vtkPolyData.</div><div>So my best guess is that it isn't a vtkPolyData.</div><div><br></div><div>Try this:</div><div><br></div><div>  print trianglePolyData.GetClassName()</div><div><br></div><div> - David</div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 16, 2014 at 4:08 PM, Ricardo Santos <span dir="ltr"><<a href="mailto:ricardo.c.r.santos@gmail.com" target="_blank">ricardo.c.r.santos@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hello everyone!<div><br></div><div>      I am having a little bit of a hard time trying to save a vtkPolyData to a stl file using Python. My main problem is that vtkSTLWriter needs a input that I can't find in vtkPolyData.</div><div><br></div><div>      The relevant code is as follows:</div><div><br></div><div><p style="margin:0px">stlWriter = vtk.vtkSTLWriter()</p>
<p style="margin:0px">stlWriter.SetFileName("test.stl")</p>
<p style="margin:0px">stlWriter.SetInput(trianglePolyData) //also used stlWriter.SetInputPort(trianglePolyData) and it has not worked</p>
<p style="margin:0px">stlWriter.Write()</p><p style="margin:0px"><br></p><p style="margin:0px">     Does anyone know how I could save the STL file?</p><span class=""><font color="#888888"><p style="margin:0px"><br></p><p style="margin:0px">Ricardo Santos</p></font></span></div></div></blockquote></div></div></div></div>