# GetOutputPolyDataConnection() not working

**URL:** <https://discourse.slicer.org/t/getoutputpolydataconnection-not-working/2334>\
**Category:** Support\
**Tags:** python, file-export, 3d-model\
**Created:** [March 16, 2018, 12:16pm UTC](https://discourse.slicer.org/t/getoutputpolydataconnection-not-working/2334 "2018-03-16T12:16:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anandmulay3](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@anandmulay3](https://discourse.slicer.org/u/anandmulay3)\
**Post date:** [March 16, 2018, 12:16pm UTC](https://discourse.slicer.org/t/getoutputpolydataconnection-not-working/2334/1 "2018-03-16T12:16:06Z")

</div>

Operating system:Windows 10  
Slicer version:4.8.1  
Expected behavior:I’m tryinng to write .ply file using python interactor but i think because of this error(GetOutputPolyDataConnection() ) it is not generating the output though plywriter.write() returns 1  
Actual behavior: showing error this attribute is not part of some vtk class

can you please give me a code which is use for exporting obj also…

thanks…

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [March 16, 2018, 1:08pm UTC](https://discourse.slicer.org/t/getoutputpolydataconnection-not-working/2334/2 "2018-03-16T13:08:43Z")

</div>

Please see below (and in future, please copy/link the code you are running and output, to give people here enough context to explain errors).

> [@About using the code of exporting a model with colors to Blender](https://discourse.slicer.org/t/about-using-the-code-of-exporting-a-model-with-colors-to-blender/299/2):
>
> I’ve fixed the obvious syntax errors (due to VTK library upgrades) in the [fiber tract export snippet](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Export_a_fiber_tracts_to_Blender.2C_including_color). If you export generic models (not fiber tracts) then you can either [export the whole scene as VRML](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Export_entire_scene_as_VRML) or [export a colored model to ply](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Export_model_to_Blender.2C_including_color_by_scalar).

---

<div class="post-metadata">

**Author:** ![anandmulay3](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@anandmulay3](https://discourse.slicer.org/u/anandmulay3)\
**Post date:** [March 16, 2018, 1:36pm UTC](https://discourse.slicer.org/t/getoutputpolydataconnection-not-working/2334/3 "2018-03-16T13:36:12Z")

</div>

AttributeError: ‘vtkCommonCorePython.vtkMRMLScalarVolumeDisplayNode’ object has no attribute ‘GetOutputPolyDataConnection’

Sorry , but this is the actual error , and i’m using same code that you have referred , still no luck…

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 16, 2018, 1:42pm UTC](https://discourse.slicer.org/t/getoutputpolydataconnection-not-working/2334/4 "2018-03-16T13:42:09Z")

</div>

Volume nodes don’t store polydata (surface mesh), but an image volume. You can create mesh from volume by segmenting it, for example by using Segment Editor module.

---

<div class="post-metadata">

**Author:** ![anandmulay3](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@anandmulay3](https://discourse.slicer.org/u/anandmulay3)\
**Post date:** [March 16, 2018, 1:48pm UTC](https://discourse.slicer.org/t/getoutputpolydataconnection-not-working/2334/5 "2018-03-16T13:48:32Z")

</div>

Ohh, okay. So i have to get segment data first…  
Thanks for the support…  
is it possible to export obj rather than .ply file??

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 16, 2018, 2:11pm UTC](https://discourse.slicer.org/t/getoutputpolydataconnection-not-working/2334/6 "2018-03-16T14:11:12Z")

</div>

Yes, you can save geometry of the model as .obj file.
