# Loading a 3D model from Blender or other 3D modeling applications (STL, 3DS, FBX file format) into the scene programmatically using Python

**URL:** <https://discourse.slicer.org/t/loading-a-3d-model-from-blender-or-other-3d-modeling-applications-stl-3ds-fbx-file-format-into-the-scene-programmatically-using-python/6555>\
**Category:** Support\
**Tags:** python, 3d-model\
**Created:** [April 22, 2019, 3:12pm UTC](https://discourse.slicer.org/t/loading-a-3d-model-from-blender-or-other-3d-modeling-applications-stl-3ds-fbx-file-format-into-the-scene-programmatically-using-python/6555 "2019-04-22T15:12:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hadi-Fooladi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hadi-fooladi/32/3290_2.png) [@Hadi-Fooladi](https://discourse.slicer.org/u/Hadi-Fooladi)\
**Post date:** [April 22, 2019, 3:12pm UTC](https://discourse.slicer.org/t/loading-a-3d-model-from-blender-or-other-3d-modeling-applications-stl-3ds-fbx-file-format-into-the-scene-programmatically-using-python/6555/1 "2019-04-22T15:12:40Z")

</div>

Hi,

I have a polygonal 3d model file and I want to import it to the scene. I can do it through user interface but I wanted to know how can I achieve this through code.

Thanks,  
Hadi

---

<div class="post-metadata">

**Author:** ![Sam\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sam_horvath/32/3092_2.png) [@Sam\_Horvath](https://discourse.slicer.org/u/Sam_Horvath)\
**Post date:** [April 22, 2019, 3:48pm UTC](https://discourse.slicer.org/t/loading-a-3d-model-from-blender-or-other-3d-modeling-applications-stl-3ds-fbx-file-format-into-the-scene-programmatically-using-python/6555/2 "2019-04-22T15:48:53Z")

</div>

Hi:

slicer.util.loadModel("/path/to/file.ext") will work for this purpose.

See: [https://www.slicer.org/wiki/Documentation/Nightly/Developers/IO#How\_to\_load\_files\_programmatically](https://www.slicer.org/wiki/Documentation/Nightly/Developers/IO#How_to_load_files_programmatically)

Supported data formats can be found here:  
[https://www.slicer.org/wiki/Documentation/4.10/SlicerApplication/SupportedDataFormat](https://www.slicer.org/wiki/Documentation/4.10/SlicerApplication/SupportedDataFormat)
