Sketcher SketchObject/de: Difference between revisions

From FreeCAD Documentation
(Created page with "# Zum Arbeitsbereich Sketcher wechseln. # Die Schaltfläche {{Button|16px Körper erstellen}} dr...")
No edit summary
Line 25: Line 25:
# Zum Arbeitsbereich [[Sketcher Workbench/de|Sketcher]] wechseln.
# Zum Arbeitsbereich [[Sketcher Workbench/de|Sketcher]] wechseln.
# Die Schaltfläche {{Button|[[File:PartDesign_Body.svg|16px]] [[PartDesign_Body/de|Körper erstellen]]}} drücken.
# Die Schaltfläche {{Button|[[File:PartDesign_Body.svg|16px]] [[PartDesign_Body/de|Körper erstellen]]}} drücken.
# Die Schaltfläche {{Button|[[File:PartDesign_NewSketch.svg|16px]] [[PartDesign_NewSketch/|PartDesign Skizze erstellen]]}} drücken.
# Die Schaltfläche {{Button|[[File:PartDesign_NewSketch.svg|16px]] [[PartDesign_NewSketch/de|PartDesign Skizze erstellen]]}} drücken.
# {{MenuCommand|Element auswählen}}: XY_Plane (Basis-Ebene), XZ_Plane (Basis-Ebene), oder YZ_Plane (Basis-Ebene).
# {{MenuCommand|Element auswählen}}: XY_Plane (Basis-Ebene), XZ_Plane (Basis-Ebene), oder YZ_Plane (Basis-Ebene).
# {{Button|OK}} drücken.
# {{Button|OK}} drücken.

Revision as of 20:17, 24 October 2022

Einleitung

Ein Sketcher SketchObject, oder formal ein Sketcher::SketchObject, ist das Basiselement für die Erstellung von 2D-Objekten mit der Arbeitsumgebung Sketcher.

Das Sketcher::SketchObject ist vom Part Part2DObject abgeleitet, d.h. es ist ein Part Feature-Objekt spezialisiert auf 2D-Geometrie. Wie das Part2DObject, kann das SketchObject Ebenen und Flächen zugeordnet werden. Zusätzlich kann das SketchObject mit geometrischen Randbedingungen arbeiten.

Vereinfachtes Diagramm der Beziehungen zwischen den Kernobjekten in FreeCAD

Anwendung

  1. Zum Arbeitsbereich Sketcher wechseln.
  2. Die Schaltfläche Sketcher NeueSkizze drücken.
  3. Eine Template:MenuCommand/de auswählen: XY-Ebene, XZ-Ebene, oder YZ-Ebene. Wahlweise die Template:MenuCommand/de aktivieren, und einen Offset-Wert eingeben.
  4. OK drücken.

Auch wenn das Sketch-Objekt eigenständig verwendet werden kann, um auf einer Fläche zu zeichnen, wird es meistens in Verbindung mit dem Arbeitsbereich PartDesign verwendet um extrudierte Volumenkörper zu erstellen.

  1. Zum Arbeitsbereich Sketcher wechseln.
  2. Die Schaltfläche Körper erstellen drücken.
  3. Die Schaltfläche PartDesign Skizze erstellen drücken.
  4. Element auswählen: XY_Plane (Basis-Ebene), XZ_Plane (Basis-Ebene), oder YZ_Plane (Basis-Ebene).
  5. OK drücken.

Eigenschaften

Siehe Eigenschaft für alle Eigenschaftstypen, die geskriptete Objekte haben können.

The Sketcher SketchObject (Sketcher::SketchObject class) is derived from the Part Part2DObject (Part::Part2DObject class) and inherits all its properties.

The Sketcher SketchObject also has the following additional properties in the property editor. Hidden properties can be shown by using the Show all command in the context menu of the property editor.

Daten

Sketch

  • Daten (Hidden)Geometry (GeometryList): a list of Part geometries that exist inside the sketch.
  • DatenConstraints: named constraints, if they exist; otherwise it is an empty list [].
  • DatenExternal Geometry (LinkSubList): a list of Part geometries outside this Sketch that are used for reference.
  • Daten (Hidden)Fully Constrained (Bool): (read-only) if true the sketch is fully constrained.

Ansicht

Auto Constraints

  • AnsichtAutoconstraints (Bool): if true constraints are automatically added when geometry is drawn.
  • AnsichtAvoid Redundant (Bool): if true redundant auto-constraints are avoided.

Grid

  • Ansicht (Hidden)Grid Auto Size (Bool): if true the grid is resized based on the boundingbox of the geometry of the sketch.
  • AnsichtGrid Size (Length): the size of the spacing of the local grid lines in the 3D view; it defaults to 10 mm.
  • AnsichtGrid Snap (Bool): if true the grid can be used to snap points.
  • AnsichtGrid Style (Enumeration): the style of the grid lines; Dashed (default) or Light.
  • AnsichtShow Grid (Bool): if true a grid local to the object will be displayed in the 3D view. This grid is independent of the Draft Grid.
  • AnsichtShow Only In Edit Mode (Bool): if true the grid is only displayed while the sketch is being edited.
  • AnsichtTight Grid (Bool): if true the local grid will be localized around the origin of the shape, otherwise it will extend itself more.
  • Ansichtmax Number Of Lines (Integer): the maximum number of lines in the grid.

Visibility automation

  • AnsichtEditing Workbench (String): name of the workbench to activate when editing the sketch; it defaults to SketcherWorkbench.
  • AnsichtForce Ortho (Bool): if true the camera will be forced to orthographic view mode when the sketch is opened.
  • AnsichtHide Dependent (Bool): if true all objects that depend on the sketch are hidden when the sketch is opened.
  • AnsichtRestore Camera (Bool): if true the camera position is saved before opening the sketch, and is restored after closing it.
  • AnsichtSection View (Bool): if true only (parts of) objects behind the sketch plane are visible while the sketch is being edited.
  • AnsichtShow Links (Bool): if true all objects used in links to external geometry are shown when the sketch is opened.
  • AnsichtShow Support (Bool): if true all objects this sketch is attached to are shown when the sketch is opened.
  • Ansicht (Hidden)Tempo Vis (PythonObject): a custom class associated with this object, that handles hiding and showing other objects when opening and closing the sketch.

Skripten

See also: FreeCAD Scripting Basics and scripted objects.

See Part Feature for the general information on adding objects to the document.

A SketchObject is created with the addObject() method of the document.

import FreeCAD as App

doc = App.newDocument()
obj = App.ActiveDocument.addObject("Sketcher::SketchObject", "Sketch")
obj.Label = "Custom label"

For Python subclassing you should create the Sketcher::SketchObjectPython object.

import FreeCAD as App

doc = App.newDocument()
obj = App.ActiveDocument.addObject("Sketcher::SketchObjectPython", "CustomSketch")
obj.Label = "Custom label"