Std SendToPythonConsole/fr: Difference between revisions

From FreeCAD Documentation
(Created page with "{{GuiCommand/fr |Name=Std SendToPythonConsole |Name/fr=Std Variable dans Python |MenuLocation=Edition → Send to Python Console |Workbenches=Tous |Shortcut={{KEY|Ctrl}}+{{KEY...")
(Created page with "{{Caption|Exemple de sortie: un bord de Part Cube a été sélectionné}}")
Line 30: Line 30:
>>> ### End command Std_SendToPythonConsole
>>> ### End command Std_SendToPythonConsole
}}
}}
{{Caption|Example output: an edge of a [[Part_Box|Part Box]] was selected}}
{{Caption|Exemple de sortie: un bord de [[Part_Box/fr|Part Cube]] a été sélectionné}}


==Usage==
==Usage==

Revision as of 10:45, 15 April 2020

Std Variable dans Python

Emplacement du menu
Edition → Send to Python Console
Ateliers
Tous
Raccourci par défaut
Ctrl+Shift+P
Introduit dans la version
0.19
Voir aussi
Aucun

Description

La commande Std Variable dans Python crée une variable dans la console Python référençant un objet sélectionné. Si une sous-forme de l'objet est sélectionnée, deux variables supplémentaires sont créées, l'une faisant référence à la forme de l'objet et l'autre faisant référence à la sous-forme elle-même. Les variables et le code impliqués peuvent être utilisés pour développer du code Python.

>>> ### Begin command Std_SendToPythonConsole
>>> obj = App.getDocument("Unnamed").getObject("Box")
>>> shp = App.getDocument("Unnamed").getObject("Box").Shape
>>> elt = App.getDocument("Unnamed").getObject("Box").Shape.Edge8
>>> ### End command Std_SendToPythonConsole

Exemple de sortie: un bord de Part Cube a été sélectionné

Usage

  1. Select a single object.
  2. There are several ways to invoke the command:
    • Select the Edit → Send to Python Console option from the menu.
    • Select the Send to Python Console option from the Tree view context menu or 3D view context menu.
    • Use the keyboard shortcut: Ctrl+Shift+P.