I got this code working, but the stl files looses the position and rotation of the parts in the assembly a2plus, how to fix that?
`
import FreeCAD
import Mesh
doc = App.ActiveDocument
export_directory = "./"
for obj in doc.Objects:
if obj.isDerivedFrom("Part::Feature"):
global_transform = obj.Placement
temp_obj = doc.addObject("Part::Feature", obj.Label + "_temp")
temp_obj.Shape = obj.Shape
temp_obj.Placement = global_transform
stl_path = export_directory + obj.Label + ".stl"
Mesh.export([temp_obj], stl_path)
doc.removeObject(temp_obj.Name)`
Thanks