Cannot export to stl file

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
squidgame
Posts: 2
Joined: Fri Nov 26, 2021 8:02 am

Cannot export to stl file

Post by squidgame »

Hello.
I would like to draw 3D file and print it out. I have draw a 3D file and exported it successfully.
But I needed to modify it.

So I have modified it and tried to export to STL in the same way.
But I have failed.
I have been trying to export it huge number of times but there was no STL file in the target directory.

I can see the different overlay icon in the "Pocket002", do it influence my problem?
icon.png
icon.png (14.93 KiB) Viewed 803 times
Following is some messages in the Report view:
17:16:41 MDIVP::onSelectionChanged - unhandled: 5
17:16:41 MDIVP::onSelectionChanged - unhandled: 4
17:16:41 MDIVP::onSelectionChanged - unhandled: 5
17:16:41 MDIVP::onSelectionChanged - unhandled: 4
17:16:41 MDIVP::onSelectionChanged - unhandled: 5
17:16:41 MDIVP::onSelectionChanged - unhandled: 4
17:16:41 MDIVP::onSelectionChanged - unhandled: 5
17:18:17 MDIVP::onSelectionChanged - unhandled: 4
17:18:17 MDIVP::onSelectionChanged - unhandled: 5
Following is some messages in the Python console:
>>> Gui.activateWorkbench("PartDesignWorkbench")
>>> ### End command Std_Workbench
>>> ### Begin command Std_Export
>>> __objs__=[]
>>> __objs__.append(FreeCAD.getDocument("cse_b63n2_bottom_v2").getObject("Body"))
>>> import Fem
>>> Fem.export(__objs__,u"D:/work/freecad/cse-b63n2/v2/sample.stl")
>>>
>>> del __objs__
>>> ### End command Std_Export
>>> Gui.runCommand('Std_Copy',0)
I have attached the source file....

Thank you in advance.
Attachments
sample.FCStd
(94.06 KiB) Downloaded 19 times
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Cannot export to stl file

Post by wmayer »

You are using the wrong module to export to STL. The FEM module doesn't know how to automatically convert a PartDesign object (the body) to an FEM mesh.

Instead use the Mesh module to export to STL:

Code: Select all

import Mesh
Mesh.export(__objs__,u"D:/work/freecad/cse-b63n2/v2/sample.stl")
User avatar
Shalmeneser
Veteran
Posts: 9475
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Cannot export to stl file

Post by Shalmeneser »

* select the step in the construction tree
* File > Export :
** File Type : STL Mesh
** Name : ??
** Save
squidgame
Posts: 2
Joined: Fri Nov 26, 2021 8:02 am

Re: Cannot export to stl file

Post by squidgame »

@wmayer Thank you for your reply. I have found that I have used a wrong menu. There is another menu for the STL file format.
I finally exported it to STL file with "STL Mesh (*.stl, *ast).
You have gave me a clue to solve my problem. thank you very much!
Post Reply