the 2 attachments show the problem.
1. create line in draft and save as fc_with_gui.fcstd
2. start fc in no-gui mode:
Code: Select all
import FreeCAD
doc = FreeCAD.openDocument("fc_with_gui.fcstd")
doc.save("fc_without_gui.fcstd")
Code: Select all
import FreeCAD
doc = FreeCAD.openDocument("fc_with_gui.fcstd")
doc.save("fc_without_gui.fcstd")
I am not sure if it is the right way. I guess this fnction is also called in nogui-mode.microelly2 wrote:Does it make sense to recreate the viewprovider after "the document is restored"?
onDocumentRestored(self, obj):
ViewProvider(obj.ViewObject)