Headless FreeCAD: Difference between revisions
(started documenting running FC inheadless mode) |
(Marked this version for translation) |
||
(10 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<languages/> |
|||
⚫ | |||
{{TOCright}} |
|||
<translate> |
|||
⚫ | |||
<!--T:2--> |
|||
This wiki page will document various aspect of running FreeCAD in the console without enabling the GUI (Graphical User Interface) or what is called 'headless'. |
This wiki page will document various aspect of running FreeCAD in the console without enabling the GUI (Graphical User Interface) or what is called 'headless'. |
||
⚫ | |||
<!--T:4--> |
|||
⚫ | |||
⚫ | |||
<!--T:5--> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
</translate> |
|||
{{Code|lang=python|code= |
{{Code|lang=python|code= |
||
import FreeCADGui as Gui |
import FreeCADGui as Gui |
||
Line 20: | Line 27: | ||
view = Gui.subgraphFromObject(obj) |
view = Gui.subgraphFromObject(obj) |
||
}} |
}} |
||
<translate> |
|||
⚫ | |||
<!--T:6--> |
|||
⚫ | |||
== Examples == <!--T:7--> |
|||
=== Searching FreeCAD Modules === <!--T:8--> |
|||
<!--T:9--> |
|||
# Open the terminal and type: |
|||
#:{{incode|$ /path/to/FreeCAD -c}} |
|||
#::or |
|||
#:{{incode|$ /path/to/FreeCADCmd}} |
|||
# A python shell will start with a prompt. Type {{incode|help()}}. |
|||
# A help text is displayed. |
|||
# Type {{incode|modules freecad}}. |
|||
⚫ | |||
<!--T:11--> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
</translate> |
|||
⚫ | |||
[[Category:Developer Documentation{{#translation:}}]] |
|||
⚫ | |||
[[Category:Poweruser Documentation{{#translation:}}]] |
Latest revision as of 09:37, 20 November 2021
Introduction
This wiki page will document various aspect of running FreeCAD in the console without enabling the GUI (Graphical User Interface) or what is called 'headless'.
Scenegraph Representation
As it's not possible to create or access the view provider in headless mode. What's possible is to load FreeCADGui
in headless mode but there is no way to access the GUI document because it won't be created and consequently there exist no view providers.
However, what's possible is to create a scenegraph representation of an object:
import FreeCADGui as Gui
from pivy import coin
Gui.setupWithoutGUI()
doc = App.newDocument()
obj = doc.addObject("Part::Box","Box")
doc.recompute()
view = Gui.subgraphFromObject(obj)
See: forum thread.
Examples
Searching FreeCAD Modules
- Open the terminal and type:
$ /path/to/FreeCAD -c
- or
$ /path/to/FreeCADCmd
- A python shell will start with a prompt. Type
help()
. - A help text is displayed.
- Type
modules freecad
.