# Trouble with creating a custom module

**URL:** <https://discourse.slicer.org/t/trouble-with-creating-a-custom-module/29732>\
**Category:** Development\
**Tags:** extensions-manager\
**Created:** [May 30, 2023, 5:59pm UTC](https://discourse.slicer.org/t/trouble-with-creating-a-custom-module/29732 "2023-05-30T17:59:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrick\_Li](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/patrick_li/32/66178_2.png) [@Patrick\_Li](https://discourse.slicer.org/u/Patrick_Li)\
**Post date:** [May 30, 2023, 5:59pm UTC](https://discourse.slicer.org/t/trouble-with-creating-a-custom-module/29732/1 "2023-05-30T17:59:37Z")

</div>

I am currently trying to create my own module with ExtensionWizard. I used QTDesigner to create the UI, which is now mostly done. What I’m trying to do now is to get the module to save data to specific folders based on user input. In this case, I want the module to be able to create new folders and then save markup data, tables, and texts within these new folders.

Here is an example of the kind of data hierarchy I’m aiming to create.

 ![Screenshot (843)](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/b/5b27016a2c83e9f5f15d1a2ebd117b51d97cf2d5.jpeg)

Here’s what my module looks like.

 ![Screenshot (845)](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/4/549cdb37003b3c5f06120734aed13f7c7c1ad561.jpeg)

---

<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:** [May 30, 2023, 8:05pm UTC](https://discourse.slicer.org/t/trouble-with-creating-a-custom-module/29732/2 "2023-05-30T20:05:25Z")

</div>

You can create folders using standard Python functions and then export nodes into them using `slicer.util.saveNode` or `slicer.util.exportNode` functions.

---

<div class="post-metadata">

**Author:** ![Patrick\_Li](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/patrick_li/32/66178_2.png) [@Patrick\_Li](https://discourse.slicer.org/u/Patrick_Li)\
**Post date:** [May 31, 2023, 6:36pm UTC](https://discourse.slicer.org/t/trouble-with-creating-a-custom-module/29732/3 "2023-05-31T18:36:56Z")

</div>

I used QT Designer to design the UI, and didn’t use any Python. I’m not sure how to make it so that pressing a certain button (“Save”) in the UI will create a folder and export the nodes.

---

<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:** [July 25, 2023, 12:34pm UTC](https://discourse.slicer.org/t/trouble-with-creating-a-custom-module/29732/4 "2023-07-25T12:34:42Z")

</div>

Your can `connect` a button event (e.g., `click`) to a Python method as it is shown in the scripted module template.
