Part Part2DObject/en

Introduction


A Part Part2DObject, or formally a, is a simple element with a topological shape that can be displayed in the 3D view.

The is derived from the Part Feature, but is specialized for 2D geometry, given that its shape will lie on a plane. This plane is defined by its property (position, normal, and rotation). However, the plane can also be defined by supporting geometrical elements, such as the plane created by three arbitrary vertices, or a face of a solid body.



Usage
The Part Part2DObject is an internal object, so it cannot be created from the graphical interface, only from the Python console as described in the Scripting section.

The is defined in the Part Workbench but can be used as the base class for scripted objects in all workbenches that produce 2D geometrical shapes. For example, it is the base object for sketches (Sketcher SketchObject), and for most objects created with the Draft Workbench.

Workbenches can add more properties to this basic element to produce an object with complex behavior.

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

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

The Part Part2DObject 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

 * : class name of the attach engine object driving the attachment. It defaults to.
 * : it is the plane or face supporting the 2D geometry. It defaults to an empty list.
 * : by default. This property determines a plane which the object will use as reference for 2D geometry. Clicking on the ellipsis  (three dots), to the right of the entry field starts the Part EditAttachment command that allows selecting the supporting plane by picking different elements in the 3D view. The different modes are:, , , , , , , , , , , , , , , , , , , , , ,.
 * : it defaults to ; if it is the Z direction will be reversed. For example, a sketch will be flipped upside down. Hidden if  is.
 * : sets point of curve to map a sketch to. It goes from to, which corresponds to the  and . It defaults to.
 * : the position of the object in the 3D view, with respect to the attachment object's placement. The placement is defined by a point (vector), and a  (axis and angle). See Placement. Hidden if  is.

Scripting
FreeCAD Scripting Basics and scripted objects.

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

A Part2DObject 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.

For Python subclassing you should create a object.