alekssadowski95 / alekssadowski95/nanoPLM

Get FreeCADGui.showMainWindow() working

Aberta
#1 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
HTML
Estrelas
73
Forks
7
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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()
```

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.