Std SendToPythonConsole/de: Difference between revisions

From FreeCAD Documentation
(Created page with "==Beschreibung==")
(Created page with "Der '''Std SendeAnPythonKonsole''' Befehl erstellt eine Variable in der Python Konsole, die auf ein ausgewähltes Objekt verweist. Wenn eine Unterform de...")
Line 20: Line 20:
==Beschreibung==
==Beschreibung==


Der '''Std SendeAnPythonKonsole''' Befehl erstellt eine Variable in der [[Python_console/de|Python Konsole]], die auf ein ausgewähltes Objekt verweist. Wenn eine Unterform des Objekts ausgewählt wird, werden zwei zusätzliche Variablen erstellt, von denen eine auf die Form des Objekts und die andere auf die Unterform selbst verweist. Die Variablen und der damit verbundene Code können zur Entwicklung von Python Code verwendet werden.
The '''Std SendToPythonConsole''' command creates a variable in the [[Python_console|Python console]] referencing a selected object. If a subshape of the object is selected two additional variables are created, one referencing the shape of the object and the other referencing the subshape itself. The variables and the code involved can be used to development Python code.


{{Code|code=
{{Code|code=

Revision as of 11:34, 7 June 2020

Std SendeAnPythonKonsole

Menüeintrag
Bearbeiten → Sende an Python Konsole
Arbeitsbereich
Alle
Standardtastenkürzel
Ctrl+Shift+P
Eingeführt in Version
0.19
Siehe auch
Keiner

Beschreibung

Der Std SendeAnPythonKonsole Befehl erstellt eine Variable in der Python Konsole, die auf ein ausgewähltes Objekt verweist. Wenn eine Unterform des Objekts ausgewählt wird, werden zwei zusätzliche Variablen erstellt, von denen eine auf die Form des Objekts und die andere auf die Unterform selbst verweist. Die Variablen und der damit verbundene Code können zur Entwicklung von Python Code verwendet werden.

>>> ### 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

Example output: an edge of a Part Box was selected

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.