Error while exporting a model node as stl file

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!

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:

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).

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…

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

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

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