# Create Folder and Get Folder

**URL:** <https://discourse.slicer.org/t/create-folder-and-get-folder/14295>\
**Category:** Support\
**Tags:** python\
**Created:** [October 28, 2020, 11:45pm UTC](https://discourse.slicer.org/t/create-folder-and-get-folder/14295 "2020-10-28T23:45:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christos\_Tzerefos](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/christos_tzerefos/32/8544_2.png) [@Christos\_Tzerefos](https://discourse.slicer.org/u/Christos_Tzerefos)\
**Post date:** [October 28, 2020, 11:45pm UTC](https://discourse.slicer.org/t/create-folder-and-get-folder/14295/1 "2020-10-28T23:45:20Z")

</div>

Hello to all,

during a part of my code, I create a folder with the following code to export a certain model I create.

> shNode = slicer.mrmlScene.GetSubjectHierarchyNode()  
> sceneItemID = shNode.GetSceneItemID()  
> exportFolderItemId = shNode.**CreateFolderItem(sceneItemID , “Models”)**

How can I check if this certain folder exists later in my code and use it to export another model?

---

<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:** [October 28, 2020, 11:50pm UTC](https://discourse.slicer.org/t/create-folder-and-get-folder/14295/2 "2020-10-28T23:50:42Z")

</div>

You can find many subject hierarchy [examples in the script repository](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Subject_hierarchy) and full documentation [here](http://apidocs.slicer.org/master/classvtkMRMLSubjectHierarchyNode.html).
