Code: Select all
FREECADPATH = "/Applications/FreeCAD.app/Contents/Resources/lib/"
import sys
sys.path.append(FREECADPATH)
import FreeCAD as App
import Part
doc = App.newDocument("house")
doc.addObject("Part::Feature", "ground").Shape = Part.makePlane(16000 , 12000, App.Vector(0,0,0), App.Vector(0,0,1) )
doc.recompute()
App.getDocument("house").saveAs("MacroTest.FCStd")
But if I run the code in macro, the face can be shown both on screen and in the file "MacroTest.FCStd" it created.
I have tried to find the instruction about how to save Fcstd file in headless mode but failed.
Tons of thanks for help!
operate system: MacOS
Version: FreeCAD 0.20.0