Sketcher SketchObject

Introduction


A Sketcher SketchObject, or formally a, is the base element to create 2D objects with the Sketcher Workbench.

The is derived from Part Part2DObject, which means it is a Part Feature object specialized for 2D geometry. Like Part2DObject, the SketchObject can be attached to planes and faces. In addition, the SketchObject can handle geometrical constraints of the lines and curves that are drawn within it.



Usage

 * 1) Switch to the Sketcher Workbench.
 * 2) Press.
 * 3) Select a : XY-plane, XZ-plane, or YZ-plane. Optionally also choose, and give an  value.
 * 4) Press.

Although the SketchObject can be used by itself to draw on a plane, it is most commonly used in conjunction with the PartDesign Workbench to create extruded solids.


 * 1) Switch to the PartDesign Workbench.
 * 2) Press.
 * 3) Press.
 * : XY_Plane (Base plane), XZ_Plane (Base plane), or YZ_Plane (Base plane).
 * 1) Press.

Properties
See Property for all property types that scripted objects can have.

The Sketcher SketchObject ( class) is derived from the 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 command in the context menu of the property editor.

Data

 * : a list of Part geometries that exist inside the sketch.
 * : named constraints, if they exist; otherwise it is an empty list.
 * : a list of Part geometries outside this Sketch that are used for reference.
 * : (read-only) if it is, the sketch is fully constrained.

View

 * : if constraints are automatically added when geometry is drawn.
 * : if redundant auto-constraint are avoided.


 * : the size of the spacing of the local grid lines in the 3D view; it defaults to.
 * : it defaults to ; if the grid can be used to snap points.
 * : the style of the grid lines; (default) or.
 * : it defaults to ; if a grid local to the object will be displayed in the 3D view. This grid is independent of the Draft Grid.
 * : if (default) the local grid will be localized around the origin of the shape, otherwise it will extend itself more.
 * : if (default) the local grid will be localized around the origin of the shape, otherwise it will extend itself more.
 * : if (default) the local grid will be localized around the origin of the shape, otherwise it will extend itself more.


 * : name of the workbench to activate when editing the sketch; it defaults to.
 * : if all objects that depend on the sketch are hidden when opening the sketch.
 * : if the camera position is saved before opening the sketch, and is restored after closing it.
 * : if all objects used in links to external geometry are shown when opening the sketch.
 * : if all objects this sketch is attached to are shown when opening the sketch.

Hidden properties View

 * : a custom class associated with this object, that handles hiding and showing other objects when opening and closing the sketch.

Scripting
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 method of the document.

This basic doesn't have a Proxy object so it can't be fully used for sub-classing.

Therefore, for Python subclassing, you should create the object.