alekssadowski95 / alekssadowski95/nanoPLM
Get FreeCADGui.showMainWindow() working
- Dominant language
- HTML
- Stars
- 72
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
Get FreeCADGui.showMainWindow() working, so that all FreeCADGui-dependent exporters are working on a server that supports a GUI.
OS: Windows 10 (64-bit) Build 19045
External app python version: 3.8.10
FreeCAD (0.21.2, Rev. 33771) Python version: 3.8.10
This works just fine:
```
try:
import FreeCADGui
print('The FreeCAD GUI Python interface has been loaded')
except:
print('FreeCAD GUI API not found. Your server may not support the GUI API. Also, check the FREECAD_ABS_PATH variable.')
```
But this does not open the main window:
```
FreeCADGui.showMainWindow()
```
This gets me the error "qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "" ":
```
FreeCADGui.showMainWindow()
FreeCADGui.exec_loop()
```
This code worked a couple of years ago:
```
import sys
FREECAD_ABS_PATH = 'C:/PROGRA~1/FreeCAD 0.18/bin'
sys.path.append(FREECAD_ABS_PATH)
import FreeCADGui
import FreeCAD
doc = FreeCAD.openDocument(f'{fcstd_file_path}')
FreeCADGui.SendMsgToActiveView("ViewFit")
FreeCADGui.activeDocument().activeView().saveImage(f'{os.path.join(project_dir_path, "freecadhub", "temp", thumbnail_image_name)}',720,480,'Current')
FreeCAD.closeDocument(doc.Name)
FreeCADGui.getMainWindow().close()
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.