Skip to content

Latest commit

 

History

History
1256 lines (867 loc) · 38.6 KB

FeaturePython_Custom_Properties.md

File metadata and controls

1256 lines (867 loc) · 38.6 KB

FeaturePython Custom Properties

Introduction

Properties are the true building stones of FeaturePython objects. Through them, the user will be able to interact and modify your object. After creating a new FeaturePython object in your document ( obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","Box") ), you can get a list of the available properties by issuing:

obj.supportedProperties()

You will get a list of available properties.

Creating a FeaturePython object and adding a property to it

This code will create an object with internal name InternalObjectName (automatically renamed to InternalObjectName001 and so on, if an object named InternalObjectName already exists) and give it the user-friendly label User-friendly label. This label will be displayed in the Tree view and Combo view. Expressions can refer to this object by its label using <<User-friendly label>>.

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"

To add a property to this object, use the long form of

obj.addProperty('App::PropertyBool', 'ThePropertyName', 'Subsection', "Description for tooltip")

App::PropertyBool

is the type of the property. The different types are described in more detail below.

You can also use the short form which omits the last two arguments. The subsection defaults to

obj.addProperty('App::PropertyBool', 'ThePropertyName')

To get or set the property, use

// set
obj.ThePropertyName = True

// get
thePropertyValue = obj.ThePropertyName

If the type of the property is App::PropertyEnumeration, the setter has a special behaviour: setting a list of strings defines the cases allowed by the enumeration, setting a string selects one of these cases. To set the list of possible cases and set the current one, use:

// possible/allowed cases
obj.ThePropertyName = ["aaa", "bbb", "ccc"]
// set
obj.ThePropertyName = "bbb"

App::PropertyAcceleration

A

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyAcceleration', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyAngle

 An angle property. It can contain an 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyAngle', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = 180
obj.ThePropertyName // returns 180.0 deg
obj.ThePropertyName.Value // returns 180.0

App::PropertyArea

A

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyArea', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyBool

 A boolean property. It can contain 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyBool', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = True
obj.ThePropertyName = False
obj.ThePropertyName // returns False

App::PropertyBoolList

A property containing a list of booleans. It can contain a Python list of booleans, e.g.

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyBoolList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = [True, False, True]
obj.ThePropertyName    // returns [True, False, True]
obj.ThePropertyName[1] // returns False

App::PropertyColor

A color property. It can contain tuple of four

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyColor', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = (0.0, 1.0, 0.5, 0.8) // (Red, Green, Blue, Transparency)
obj.ThePropertyName // returns (0.0, 1.0, 0.5, 0.8)

App::PropertyColorList

A

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyColorList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyDirection

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyDirection', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyDistance

 A distance property. It can contain a 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyDistance', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = 500
obj.ThePropertyName // returns 500.0 mm
obj.ThePropertyName.Value // returns 500.0

App::PropertyEnumeration

An enumeration property. The allowed items are defined by setting the property to a list. After that, it can contain items of the given list. The list of allowed items can be changed by setting the property to a list again. For more details, see the section about Creating a FeaturePython object and adding a property to it.

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyEnumeration', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = ["Foo", "Bar", "Baz"]  // set allowed items
obj.ThePropertyName = "Foo"                  // choose single item
obj.ThePropertyName = ["Foo", "Bar", "Quux"] // change allowed items
obj.ThePropertyName = "Quux"                 // choose single item
obj.ThePropertyName // returns "Quux"

App::PropertyExpressionEngine

A

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyExpressionEngine', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyFile

 A filename property. It can contain a string indicating the path to a filename 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyFile', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyFileIncluded

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyFileIncluded', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyFloat

 A float property. It can contain a 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyFloat', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = 15.7
obj.ThePropertyName // returns 15.7

App::PropertyFloatConstraint

A float constraint property. It can contain a

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyFloatConstraint', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = (50.0, 0.0, 100.0, 1.0) // (Default, Start, Finish, Step)
obj.ThePropertyName // returns 50.0

App::PropertyFloatList

A float list property. It can contain list of

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyFloatList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = [12.7, 5.8, 28.6, 17.22] // Also it can be an empty list.
obj.ThePropertyName // returns [12.7, 5.8, 28.6, 17.22]

App::PropertyFont

A

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyFont', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyForce

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyForce', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyFrequency

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyFrequency', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyInteger

 An integer property. It can contain an integer value. For more details, see the section about [Creating a FeaturePython object and adding a property to it](#Creating.md). 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyInteger', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = 25
obj.ThePropertyName // returns 25

App::PropertyIntegerConstraint

An integer constraint property. It can contain an

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyIntegerConstraint', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = (50, 0, 100, 1) // (Default, Start, Finish, Step)
obj.ThePropertyName // returns 50

App::PropertyIntegerList

An integer list property. It can contain list of

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyIntegerList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = [12, 5, 28, 17] // Also it can be an empty list.
obj.ThePropertyName // returns [12, 5, 28, 17]

App::PropertyIntegerSet

A

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyIntegerSet', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyLength

 A length property. It can contain a 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyLength', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = 500
obj.ThePropertyName // returns 500 mm
obj.ThePropertyName.Value // returns 500

App::PropertyLink

A link property. It can contain link to an object. When you call this property, it will return the linked object. For more details, see the section about Creating a FeaturePython object and adding a property to it.

link_obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","LinkObjectName")
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyLink', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = link_obj
obj.ThePropertyName // returns link_obj

App::PropertyLinkChild

A

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyLinkChild', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyLinkGlobal

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyLinkGlobal', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyLinkHidden

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyLinkHidden', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyLinkList

 A link list property. It can contain list of linked objects. For more details, see the section about [Creating a FeaturePython object and adding a property to it](#Creating.md). 


```python
link_obj0=FreeCAD.ActiveDocument.addObject("App::FeaturePython","LinkObjectName0")
link_obj1=FreeCAD.ActiveDocument.addObject("App::FeaturePython","LinkObjectName1")
link_obj2=FreeCAD.ActiveDocument.addObject("App::FeaturePython","LinkObjectName2")

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyLinkList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = [link_obj0, link_obj1, link_obj2]
obj.ThePropertyName // returns [link_obj0, link_obj1, link_obj2]

App::PropertyLinkListChild

A

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyLinkListChild', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyLinkListGlobal

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyLinkListGlobal', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyLinkListHidden

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyLinkListHidden', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyLinkSub

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyLinkSub', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyLinkSubChild

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyLinkSubChild', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyLinkSubGlobal

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyLinkSubGlobal', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyLinkSubHidden

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyLinkSubHidden', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyLinkSubList

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyLinkSubList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyLinkSubListChild

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyLinkSubListChild', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyLinkSubListGlobal

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyLinkSubListGlobal', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyLinkSubListHidden

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyLinkSubListHidden', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyMap

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyMap', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyMaterial

 A material property. It can contain a FreeCAD material object. For more details, see the section about [Creating a FeaturePython object and adding a property to it](#Creating.md). 


```python
import FreeCAD
material=FreeCAD.Material()

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyMaterial', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = material
obj.ThePropertyName // returns material

App::PropertyMaterialList

A material list property. It can contain list of materials. For more details, see the section about Creating a FeaturePython object and adding a property to it.

import FreeCAD
material0 = FreeCAD.Material()
material1 = FreeCAD.Material()
material2 = FreeCAD.Material()

obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyMaterialList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = [material0, material1, material2] // Also it can be an empty list.
obj.ThePropertyName // returns [material0, material1, material2]

App::PropertyMatrix

A

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyMatrix', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyPath

 A path property. It can contain a string representing a path to a folder 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyPath', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyPercent

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyPercent', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyPersistentObject

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyPersistentObject', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyPlacement

 A placement property. It can contain 


```python
import FreeCAD
placement = FreeCAD.Placement()
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyPlacement', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = placement
obj.ThePropertyName // returns placement

App::PropertyPlacementLink

A

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyPlacementLink', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyPlacementList

 A placement list property. It can contain list of 


```python
import FreeCAD
placement0 = FreeCAD.Placement()
placement1 = FreeCAD.Placement()
placement2 = FreeCAD.Placement()

obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyPlacementList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = [placement0, placement1, placement2]
obj.ThePropertyName // returns [placement0, placement1, placement2]

App::PropertyPosition

A

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyPosition', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyPrecision

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyPrecision', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyPressure

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyPressure', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyPythonObject

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyPythonObject', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyQuantity

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyQuantity', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyQuantityConstraint

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyQuantityConstraint', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertySpeed

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertySpeed', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyString

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyString', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyStringList

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyStringList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyUUID

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyUUID', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyVacuumPermittivity

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyVacuumPermittivity', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyVector

 A vector property. It can contain a FreeCAD 


```python
import FreeCAD
vector = FreeCAD.Vector(0, -2, 5)

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyVector', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = vector
obj.ThePropertyName // returns Vector(0, -2, 5)

App::PropertyVectorDistance

A

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyVectorDistance', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyVectorList

 A vector list property. It can contain list of 


```python
import FreeCAD
v0 = FreeCAD.Vector(0, 10, 0)
v1 = FreeCAD.Vector(0, 10, 0)
v2 = FreeCAD.Vector(30, -10, 0)
v3 = FreeCAD.Vector(0, -10, 0)

obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyVectorList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = [v0, v1, v2, v3]
obj.ThePropertyName // returns [Vector(0, 10, 0), Vector(0, 10, 0), Vector(30, -10, 0), Vector(0, -10, 0)]

App::PropertyVolume

A

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyVolume', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyXLink

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyXLink', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyXLinkList

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyXLinkList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyXLinkSub

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyXLinkSub', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## App::PropertyXLinkSubList

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('App::PropertyXLinkSubList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## Mesh::PropertyCurvatureList

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('Mesh::PropertyCurvatureList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## Mesh::PropertyMeshKernel

 A mesh kernel property. It can contain a 


```python
import Mesh
mesh = Mesh.Mesh()

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('Mesh::PropertyMeshKernel', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = mesh
obj.ThePropertyName // returns mesh

Mesh::PropertyNormalList

A

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('Mesh::PropertyNormalList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## Part::PropertyFilletEdges

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('Part::PropertyFilletEdges', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## Part::PropertyGeometryList

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('Part::PropertyGeometryList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## Part::PropertyPartShape

 A part shape property. It can contain 


```python
import Part
part = Part.Shape()

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('Part::PropertyPartShape', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = part
obj.ThePropertyName // returns part

Part::PropertyShapeHistory

A

obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('Part::PropertyShapeHistory', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## Path::PropertyPath

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('Path::PropertyPath', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## Path::PropertyTool

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('Path::PropertyTool', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## Path::PropertyTooltable

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('Path::PropertyTooltable', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## Sketcher::PropertyConstraintList

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('Sketcher::PropertyConstraintList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## Spreadsheet::PropertyColumnWidths

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('Spreadsheet::PropertyColumnWidths', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## Spreadsheet::PropertyRowHeights

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('Spreadsheet::PropertyRowHeights', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## Spreadsheet::PropertySheet

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('Spreadsheet::PropertySheet', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## Spreadsheet::PropertySpreadsheetQuantity

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('Spreadsheet::PropertySpreadsheetQuantity', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## TechDraw::PropertyCenterLineList

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('TechDraw::PropertyCenterLineList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## TechDraw::PropertyCosmeticEdgeList

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('TechDraw::PropertyCosmeticEdgeList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## TechDraw::PropertyCosmeticVertexList

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('TechDraw::PropertyCosmeticVertexList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}

## TechDraw::PropertyGeomFormatList

 A 


```python
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty('TechDraw::PropertyGeomFormatList', 'ThePropertyName', 'Subsection', 'Description for tooltip')
obj.ThePropertyName = {{TODO```"example value for setter"
obj.ThePropertyName // returns {{TODO}}"example value for getter"
}}




[<img src="images/Property.png" style="width:16px"> API](Category_API.md) [<img src="images/Property.png" style="width:16px"> Developer Documentation](Category_Developer_Documentation.md)

---
[documentation index](../README.md) > [API](Category_API.md) > FeaturePython Custom Properties