Skip to content

model generation without firing up the FreeCAD GUI #257

@tolot27

Description

@tolot27

I'd like to generate the 3D packages with main_generator.py script(s). Later on, I'll generate my newly created parts the same way. Unfortunately, the scripts fail with:

C:\Common\FreeCAD-0.17\bin\python.exe main_generator.py
FreeCAD 0.17, Libs: 0.17R13541 (Git)
Traceback (most recent call last):
  File "main_generator.py", line 64, in <module>
    import exportPartToVRML as expVRML
  File "../_tools\exportPartToVRML.py", line 100, in <module>
    clear_console()
  File "../_tools\exportPartToVRML.py", line 93, in clear_console
    mw=FreeCADGui.getMainWindow()
AttributeError: 'module' object has no attribute 'getMainWindow'

Then I realized that I have to call the main_generator.py script(s) with FreeCAD rather than with python. This is not documented by the way.

Afterwards, the FreeCad GUI is poping up the the conversion starts.

During my search regarding to the getMainWindow error I found the documentation about Embedding FreeCADGui. Especially the section Without even firing up the FreeCAD Gui was quite interesting to read. Maybe, this is an option for the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions