# Error while exporting a model node as stl file

**URL:** <https://discourse.slicer.org/t/error-while-exporting-a-model-node-as-stl-file/29047>\
**Category:** Support\
**Tags:** file-export, stl, 3d-model\
**Created:** [April 21, 2023, 1:19pm UTC](https://discourse.slicer.org/t/error-while-exporting-a-model-node-as-stl-file/29047 "2023-04-21T13:19:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luca](https://avatars.discourse-cdn.com/v4/letter/l/51bf81/32.png) [@Luca](https://discourse.slicer.org/u/Luca)\
**Post date:** [April 21, 2023, 1:19pm UTC](https://discourse.slicer.org/t/error-while-exporting-a-model-node-as-stl-file/29047/1 "2023-04-21T13:19:59Z")

</div>

Hello everyone,

every time I try to export a model node (simple or complex) as stl file by using the GUI, I get the following error:

> Error: ERROR: In D:\D\S\S-0-build\VTK\IO\Geometry\vtkSTLWriter.cxx, line 248  
> vtkSTLWriter (000001870E471130): Couldn’t open file: C:/Users/user/Desktop/New folder/bone.stl Reason: Permission denied  
> Error: Saving failed with all writers found for file ‘C:/Users/user/Desktop/New folder/bone.stl’ of type ‘ModelFile’.  
> Error: Error encountered while exporting liver.  
> Error: ERROR: In D:\D\S\S-0-build\VTK\IO\Geometry\vtkSTLWriter.cxx, line 248  
> vtkSTLWriter (000001870E471130): Couldn’t open file: C:/Users/user/Desktop/New folder/bone.stl Reason: Permission denied

However, if I save the model node by code using slicer.util.saveNode() the Python Interactor, it works.

Can someone explain me what is happening and why? It is strange that it searches in D: because my pc has got just one disk (C:). Did anything go wrong during Slicer installation? Any other hints?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Post date:** [April 21, 2023, 2:03pm UTC](https://discourse.slicer.org/t/error-while-exporting-a-model-node-as-stl-file/29047/2 "2023-04-21T14:03:04Z")

</div>

> [@Luca](#):
>
> D:\D\S\S-0-build\VTK\IO\Geometry\vtkSTLWriter.cxx, line 248

If you are using a pre-compiled binary of Slicer, this is probably the path where the source tree was located when built. I would think you can safely ignore this.

However, it seems the application does not have permission to write in the following folder:

> [@Luca](#):
>
> C:/Users/user/Desktop/New folder

Are you able to create a file in that folder using any other application? Could you try also in a new folder without spaces in the name? (e.g., C:/Users/user/Desktop/newfolder).

---

<div class="post-metadata">

**Author:** ![Luca](https://avatars.discourse-cdn.com/v4/letter/l/51bf81/32.png) [@Luca](https://discourse.slicer.org/u/Luca)\
**Post date:** [April 21, 2023, 2:42pm UTC](https://discourse.slicer.org/t/error-while-exporting-a-model-node-as-stl-file/29047/3 "2023-04-21T14:42:58Z")

</div>

Thanks for your quick reply.

Spaces don’t influence the result and yes, I can create files in that folder. For sure It is a permission problem, but I configured my two computers in the same way and installed Slicer in the same way. Why does the problem appear on just one pc?  
I will try re-installing it again with administrator permissions, but on the other pc I didn’t do so…

---

<div class="post-metadata">

**Author:** ![Luca](https://avatars.discourse-cdn.com/v4/letter/l/51bf81/32.png) [@Luca](https://discourse.slicer.org/u/Luca)\
**Post date:** [April 24, 2023, 8:20am UTC](https://discourse.slicer.org/t/error-while-exporting-a-model-node-as-stl-file/29047/4 "2023-04-24T08:20:53Z")

</div>

Update:  
I have re-installed Slicer as administrator, but I still cannot export models to stl files. The error is still the same as above

---

<div class="post-metadata">

**Author:** ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Post date:** [April 25, 2023, 1:59pm UTC](https://discourse.slicer.org/t/error-while-exporting-a-model-node-as-stl-file/29047/5 "2023-04-25T13:59:05Z")

</div>

This sounds strange to me and probably a Windows configuration issue, not Slicer. I have given a quick scan to similar problems online and found this post which offers different strategies to deal with the same (or similar problem):

[https://answers.microsoft.com/en-us/windows/forum/all/cusersusernamedesktop-is-not-accessible/69860653-d076-4c62-aa3d-5cce22f838e3](https://answers.microsoft.com/en-us/windows/forum/all/cusersusernamedesktop-is-not-accessible/69860653-d076-4c62-aa3d-5cce22f838e3)

I unfortunately cannot reproduce the issue. I hope this helps.
