Std AnPythonKonsoleSenden
|
|
| Menüeintrag |
|---|
| Bearbeiten → An Python-Konsole senden |
| Arbeitsbereich |
| Alle |
| Standardtastenkürzel |
| Ctrl+Shift+P |
| Eingeführt in Version |
| 0.19 |
| Siehe auch |
| Keiner |
Beschreibung
Der Befehl Std AnPythonKonsoleSenden erstellt Variablen in der Python-Konsole, die auf ein ausgewähltes Objekt und auf seine ausgewählten Teilformen verweisen, zusammen mit ein paar nützlichen anderen Referenzen. Die Variablen und der dazugehörige Kode können zur Entwicklung von Python-Skripten verwendet werden.
Abhängig von dem ausgewählten Objekt und seiner ausgewählten Teilformen, falls vorhanden, werden die folgenden Variablen erstellt:
| Variable name | Referenced object(s) |
|---|---|
doc |
The document containing the selected object |
lnk |
The selected Link object (only created if the selected object is a Link) |
obj |
Depending on the selected object: The selected object itself (if the selected object is not a Link) |
shp |
Depending on the type of obj:The |
sub |
The first selected subshape (only created if at least one subshape is selected) |
subs |
A list containing all subshapes (only created if two or more subshapes are selected) |
>>> ### Begin command Std_SendToPythonConsole
>>> try:
>>> del(doc,lnk,obj,shp,sub,subs)
>>> except Exception:
>>> pass
>>>
>>> doc = App.getDocument("Unnamed")
>>> lnk = doc.getObject("Link")
>>> obj = lnk.getLinkedObject()
>>> shp = obj.Shape
>>> sub = obj.getSubObject("Edge10")
>>> subs = [obj.getSubObject("Edge10"),obj.getSubObject("Face3"),obj.getSubObject("Vertex5"),]
>>> ### End command Std_SendToPythonConsole
Beispielausgabe: Eine Kante, eine Fläche und ein Eckpunkt eines Part Quaders wurden ausgewählt
Anwendung
- Ein einzelnes Objekt oder eine bzw. mehrere Teilformen, die zu einem einzelnen Objekt gehören, auswählen.
- Es gibt mehrere Möglichkeiten den Befehl aufzurufen:
- Den Menüeintrag Bearbeiten →
An Python-Konsole senden auswählen.
- Den Menüeintrag
An Python-Konsole senden im Kontextmenü der Baumansicht oder im Kontextmenü der 3D-Ansicht auswählen.
- Das Tastaturkürzel Strg+Shift+P.
- Den Menüeintrag Bearbeiten →
- Falls erforderlich öffnet sich die Python-Konsole.
- Die Python-Konsole erhält den Fokus der Tastatur.
Hinweise
- Jedes Mal, wenn der Befehl ausgeführt wird, werden alle vorher erzeugten Variablen gelöscht.
- If the selected object is a Link (
App::Link) and the Linked object is derived from thePart::Featureclass, theshpvariable will be the shape of the Linked object. If the Link has been transformed or scaled and you want to access the scaled/transformed shape, you can do so with this code:
lnk_shp = Part.getShape(lnk)
- File: New Document, Open, Open Recent, Close, Close All, Save, Save As, Save Copy, Save All, Revert, Import, Export,Merge Document, Document Information, Print, Print Preview, Export PDF, Exit
- Edit: Undo, Redo, Cut, Copy, Paste, Duplicate Object, Recompute, Box Selection, Box Element Selection, Select All, Delete, Send to Python Console, Placement, Transform, Align To, Toggle Edit Mode, Properties, Edit Mode, Preferences
- View:
- Miscellaneous: New 3D View, Orthographic View, Perspective View, Fullscreen, Bounding Box, Toggle Axis Cross, Clipping View, Texture Mapping, Toggle Navigation/Edit Mode, Material, Appearance, Random Color, Appearance per Face, Toggle Transparency, Workbench, Status Bar
- Standard Views: Fit All, Fit Selection, Align to Selection, Isometric, Dimetric, Trimetric, Home, Front, Top, Right, Rear, Bottom, Left, Rotate Left, Rotate Right, Store Working View, Recall Working View
- Freeze Display: Save Views, Load Views, Freeze View, Clear Views
- Draw Style: As Is, Points, Wireframe, Hidden Line, No Shading, Shaded, Flat Lines
- Stereo: Stereo Red/Cyan, Stereo Quad Buffer, Stereo Interleaved Rows, Stereo Interleaved Columns, Stereo Off, Issue Camera Position
- Zoom: Zoom In, Zoom Out, Box Zoom
- Document Window: Docked, Undocked, Fullscreen
- Visibility: Toggle Visibility, Show Selection, Hide Selection, Select Visible Objects, Toggle All Objects, Show All Objects, Hide All Objects, Toggle Selectability
- Toolbars: File, Edit, Clipboard, Workbench, Macro, View, Individual Views, Structure, Help, Lock Toolbars
- Panels: Tree View, Property View, Model, Selection View, Python Console, Report View, Tasks, DAG View
- Overlay Docked Panel: Toggle Overlay for All Panels, Toggle Transparent Panels, Toggle Overlay, Toggle Transparent Mode, Bypass Mouse Events in Overlay Panels, Toggle Left, Toggle Right, Toggle Top, Toggle Bottom
- Link Navigation: Go to Linked Object, Go to Deepest Linked Object, Select All Links
- Tree View Actions: Sync View, Sync Selection, Sync Placement, Preselection, Record Selection, Single Document, Multi Document, Collapse/Expand, Initiate Dragging, Go to Selection, Selection Back, Selection Forward
- Tools: Addon Manager, Measure, Clarify Selection, Quick Measure, Units Converter, Load Image, Save Image, Text Document, View Turntable, Scene Inspector, Dependency Graph, Export Dependency Graph, Document Utility, Edit Parameters, Customize
- Macro: Record Macro, Macros, Recent Macros, Execute Macro, Attach to Remote Debugger, Debug Macro, Stop Debugging, Step Over, Step Into, Toggle Breakpoint
- Help: What's This, Start Page, Users Documentation, FreeCAD Forum, Report an Issue, Restart in Safe Mode, Developers Handbook, Python Modules Documentation, FreeCAD Website, Donate to FreeCAD, About FreeCAD
- Additional:
- Miscellaneous: New Part, New Group, Variable Set, Link Group, Select All Instances, Toggle Freeze
- Datums: Coordinate System, Datum Plane, Datum Line, Datum Point
- Link Actions: Make Link, Make Sub-Link, Replace With Link, Unlink, Import Link, Import All Links
- Expression Actions: Copy Selected, Copy Active Document, Copy All Documents, Paste
- Selection Filter: Vertex Selection, Edge Selection, Face Selection, No Selection Filters
- Erste Schritte
- Installation: Herunterladen, Windows, Linux, Mac, Zusätzliche Komponenten, Docker, AppImage, Ubuntu Snap
- Grundlagen: Über FreeCAD, Graphische Oberfläche, Mausbedienung, Auswahlmethoden, Objektname, Voreinstellungseditor, Arbeitsbereiche, Dokumentstruktur, Objekteigenschaften, FreeCAD unterstützen, Spenden
- Hilfe: Anleitungen, Videoanleitungen
- Arbeitsbereiche: Std Base, Arch, Assembly, BIM, CAM, Draft, FEM, Inspection, Material, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework