FreeCADGui API/fr: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
No edit summary
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages/>
This module is the counterpart of the FreeCAD module. It contains everything related to the User interface and the 3D views. Example:
{{VeryImportantMessage|(octobre 2019) Ne pas éditer cette page. L'information est incomplète et obsolète. Pour la dernière API, voir la [https://www.freecadweb.org/api documentation de l'API générée automatiquement], ou générez la documentation vous-même, voir [[Source documentation/fr|Documentation du code source]].}}

Ce module est le pendant du module FreeCAD. Il contient tout ce qui touche à l'interface utilisateur et les vues 3D. Exemple:
{{Code|code=
{{Code|code=
import FreeCADGui
import FreeCAD as App
doc = FreeCADGui.activeDocument()
import FreeCADGui as Gui
}}


# get the 3D model document
doc = App.ActiveDocument


# get the visual representation model document
{{APIFunction|activateWorkbench|string|Activates a workbench by name|nothing}}
gui_doc = Gui.ActiveDocument
{{APIFunction|activeDocument| | |the active document or None if no one exists}}
{{APIFunction|activeWorkbench| | |the active workbench object}}
{{APIFunction|addCommand|string, object|Adds a FreeCAD command. String is the name of the command and object is a classname defining the command| }}
{{APIFunction|addIcon|string, string or list|Adds an icon as file name or in XPM format to the system| }}
{{APIFunction|addIconPath|string|Add a new path to the system where to find icon files| }}
{{APIFunction|addPreferencePage|string,string|Adds a UI form to the preferences dialog. The first argument specifies the file name and the second specifies the group name| }}
{{APIFunction|addWorkbench|string, object|Adds a workbench under a defined name. The string is the workbench name and the object is a classname defining the workbench| }}
{{APIFunction|createDialog|string|Opens a UI file| }}
{{APIFunction|getDocument|string|Gets a document by its name|the document}}
{{APIFunction|getWorkbench|string|Gets a workbench by its name|the workbench}}
{{APIFunction|insert|string|Open a macro, Inventor or VRML file|the document}}
{{APIFunction|listWorkbenches| |Shows a list of all workbenches|a list}}
{{APIFunction|open|string|Opens a macro, Inventor or VRML file|the openend document}}
{{APIFunction|removeWorkbench|string|Removes a workbench by name| }}
{{APIFunction|runCommand|string|Runs a FreeCAD command by name| }}
{{APIFunction|updateGui| |Updates the main window and all its windows| }}


gui_doc.activateWorkbench("myWorkbench")
[[Category:API/fr]]
}}



{{APIFunction | activate Workbench | chaîne | Active un atelier par nom | rien}}
{{APIFunction | activeDocument | | | le document actif ou None si rien n'existe}}
{{APIFunction | activeWorkbench | | | l'objet de l'atelier actif}}
{{APIFunction | addCommand | chaîne, object | Ajoute une commande FreeCAD. Chaîne est le nom de la commande et l'objet est un nom de classe définissant la commande |}}
{{APIFunction | AddIcon | chaîne, chaîne or liste | Ajoute une icône comme nom de fichier ou dans le format XPM du système |}}
{{APIFunction | addIconPath | chaîne | Ajouter un nouveau chemin d'accès au système où trouver les fichiers d'icônes |}}
{{APIFunction | addPreferencePage | chaîne, chaîne | Ajoute une forme d'interface utilisateur pour la boîte de dialogue des préférences. Le premier argument spécifie le nom du fichier et le second spécifie le nom du groupe |}}
{{APIFunction | addWorkbench | chaîne, object | Ajoute un atelier sous un nom défini. La chaîne est le nom de l'atelier et l'objet est un nom de classe définissant l'atelier |}}
{{APIFunction | createDialog | chaîne | Ouvre un fichier d'interface |}}
{{APIFunction | getDocument | chaîne | Obtient un document par son nom | le document}}
{{APIFunction | getWorkbench | chaîne | Obtient un atelier par son nom | l'atelier}}
{{APIFunction | Insert | chaîne | Ouvrir une macro, Inventor ou un fichier VRML | document}}
{{APIFunction | listWorkbenches | | Affiche une liste de toutes les ateliers | liste}}
{{APIFunction | open | chaîne | Ouvre une macro, Inventor ou un fichier VRML | le document ouvert}}
{{APIFunction | removeWorkbench | chaîne | Supprime un atelier par nom |}}
{{APIFunction | RunCommand | chaîne | Exécute une commande FreeCAD par nom |}}
{{APIFunction | updateGui | | Mise à jour de la fenêtre principale et toutes ses fenêtres |}}

{{Userdocnavi{{#translation:}}}}
[[Category:API{{#translation:}}]]
[[Category:Poweruser Documentation{{#translation:}}]]
{{clear}}
{{clear}}
<languages/>

Latest revision as of 20:56, 16 January 2024

Other languages:
(octobre 2019) Ne pas éditer cette page. L'information est incomplète et obsolète. Pour la dernière API, voir la documentation de l'API générée automatiquement, ou générez la documentation vous-même, voir Documentation du code source.

Ce module est le pendant du module FreeCAD. Il contient tout ce qui touche à l'interface utilisateur et les vues 3D. Exemple:

import FreeCAD as App
import FreeCADGui as Gui

# get the 3D model document
doc = App.ActiveDocument    

# get the visual representation model document
gui_doc = Gui.ActiveDocument

gui_doc.activateWorkbench("myWorkbench")


activate Workbench ( chaîne )

Description: Active un atelier par nom

Returns: rien

activeDocument ( )

Description:

Returns: le document actif ou None si rien n'existe

activeWorkbench ( )

Description:

Returns: l'objet de l'atelier actif

addCommand ( chaîne, object )

Description: Ajoute une commande FreeCAD. Chaîne est le nom de la commande et l'objet est un nom de classe définissant la commande

Returns:

AddIcon ( chaîne, chaîne or liste )

Description: Ajoute une icône comme nom de fichier ou dans le format XPM du système

Returns:

addIconPath ( chaîne )

Description: Ajouter un nouveau chemin d'accès au système où trouver les fichiers d'icônes

Returns:

addPreferencePage ( chaîne, chaîne )

Description: Ajoute une forme d'interface utilisateur pour la boîte de dialogue des préférences. Le premier argument spécifie le nom du fichier et le second spécifie le nom du groupe

Returns:

addWorkbench ( chaîne, object )

Description: Ajoute un atelier sous un nom défini. La chaîne est le nom de l'atelier et l'objet est un nom de classe définissant l'atelier

Returns:

createDialog ( chaîne )

Description: Ouvre un fichier d'interface

Returns:

getDocument ( chaîne )

Description: Obtient un document par son nom

Returns: le document

getWorkbench ( chaîne )

Description: Obtient un atelier par son nom

Returns: l'atelier

Insert ( chaîne )

Description: Ouvrir une macro, Inventor ou un fichier VRML

Returns: document

listWorkbenches ( )

Description: Affiche une liste de toutes les ateliers

Returns: liste

open ( chaîne )

Description: Ouvre une macro, Inventor ou un fichier VRML

Returns: le document ouvert

removeWorkbench ( chaîne )

Description: Supprime un atelier par nom

Returns:

RunCommand ( chaîne )

Description: Exécute une commande FreeCAD par nom

Returns:

updateGui ( )

Description: Mise à jour de la fenêtre principale et toutes ses fenêtres

Returns: