# Exporting Segment as OBJ through Python

**URL:** <https://discourse.slicer.org/t/exporting-segment-as-obj-through-python/10802>\
**Category:** Support\
**Created:** [March 23, 2020, 7:20pm UTC](https://discourse.slicer.org/t/exporting-segment-as-obj-through-python/10802 "2020-03-23T19:20:42Z")\
**Posts on this page:** 1\
**Showing post:** 7

<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 27, 2020, 6:39pm UTC](https://discourse.slicer.org/t/exporting-segment-as-obj-through-python/10802/7 "2020-03-27T18:39:35Z")

</div>

To get help on how to use a method, use `help` method in the Python interactor:

```nohighlight
>>> help(slicer.vtkSlicerSegmentationsModuleLogic.ExportSegmentsClosedSurfaceRepresentationToFiles)
Help on method_descriptor:

ExportSegmentsClosedSurfaceRepresentationToFiles(...)
    V.ExportSegmentsClosedSurfaceRepresentationToFiles(string,
        vtkMRMLSegmentationNode, vtkStringArray, string, bool, float,
        bool) -> bool
    C++: static bool ExportSegmentsClosedSurfaceRepresentationToFiles(
        std::string destinationFolder,
        vtkMRMLSegmentationNode *segmentationNode,
        vtkStringArray *segmentIds=nullptr,
        std::string fileFormat="STL", bool lps=true,
        double sizeScale=1.0, bool merge=false)
    
    Export closed surface representation of multiple segments to
    files. Typically used for writing 3D printable model files.

```

As you can see, a `vtkStringArray` object is expected, while you provided a Python list of strings. If you want to export all segments, you can use `None`, if you want to export specific segments, create a `vtk.vtkStringArray` object and add the segment IDs that you would like to export.

---

_[View the full topic](https://discourse.slicer.org/t/exporting-segment-as-obj-through-python/10802)._
