FeaturePython Custom Properties: Difference between revisions
Hakanseven12 (talk | contribs) |
(V1.0 -> V0.21) |
||
(62 intermediate revisions by 5 users not shown) | |||
Line 4: | Line 4: | ||
== Introduction == <!--T:8--> |
== Introduction == <!--T:8--> |
||
<!--T:108--> |
|||
See also: [https://freecad.github.io/SourceDoc/dd/dc2/namespaceApp.html Autogenerated API documentation (C++ documentation)]. |
|||
<!--T:9--> |
<!--T:9--> |
||
Properties are the true building |
Properties are the true building blocks 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: |
||
</translate> |
|||
{{Code|code= |
|||
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "Box") |
|||
}} |
|||
<translate> |
|||
<!--T:104--> |
|||
You can get a list of the available properties by issuing: |
|||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
Line 12: | Line 25: | ||
}} |
}} |
||
<translate> |
<translate> |
||
<!--T:7--> |
|||
You will get a list of available properties. |
|||
== <span id="Creating"> Creating a FeaturePython object and adding a property to it == <!--T:10--> |
== <span id="Creating"> Creating a FeaturePython object and adding a property to it == <!--T:10--> |
||
<!--T:103--> |
<!--T:103--> |
||
This code will create an object with internal name {{incode|InternalObjectName}} (automatically renamed to {{incode|InternalObjectName001}} and so on, if an object named {{incode|InternalObjectName}} already exists) and give it the user-friendly label {{incode|User-friendly label}} |
This code will create an object with internal name {{incode|InternalObjectName}} (automatically renamed to {{incode|InternalObjectName001}} and so on, if an object named {{incode|InternalObjectName}} already exists) and give it the user-friendly label {{incode|User-friendly label}}. This label will be displayed in the [[Tree_view|Tree view]]. [[Expressions|Expressions]] can refer to this object by its label using {{incode|<<User-friendly label>>}}. |
||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
}} |
}} |
||
<translate> |
<translate> |
||
<!--T:11--> |
<!--T:11--> |
||
To add a property to this object, use the long form of {{incode|addProperty}} as shown below. FreeCAD will automatically split {{incode|ThePropertyName}} and display it with spaces ({{incode|The Property Name}}) in the [[Property_editor#View_and_Data_properties|Data tab of the Property |
To add a property to this object, use the long form of {{incode|addProperty}} as shown below. FreeCAD will automatically split {{incode|ThePropertyName}} and display it with spaces ({{incode|The Property Name}}) in the [[Property_editor#View_and_Data_properties|Data tab of the Property editor]]. |
||
</translate> |
|||
</translate> |
|||
{{Code|code= |
{{Code|code= |
||
obj.addProperty( |
obj.addProperty("App::PropertyBool", "ThePropertyName", "Subsection", "Description for tooltip") |
||
}} |
}} |
||
<translate> |
|||
<!--T:105--> |
|||
{{incode|App::PropertyBool}} is the type of the property. The different types are described in more detail below. |
{{incode|App::PropertyBool}} is the type of the property. The different types are described in more detail below. |
||
<translate> |
|||
<!--T:12--> |
<!--T:12--> |
||
You can also use the short form which omits the last two arguments. The subsection defaults to {{incode|Base}}, and the tooltip is not displayed with this form. |
You can also use the short form which omits the last two arguments. The subsection defaults to {{incode|Base}}, and the tooltip is not displayed with this form. |
||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
obj.addProperty( |
obj.addProperty("App::PropertyBool", "ThePropertyName") |
||
}} |
}} |
||
<translate> |
|||
<translate> |
|||
<!--T:13--> |
<!--T:13--> |
||
To get or set the property, use {{incode|obj.ThePropertyName}} |
To get or set the property, use {{incode|obj.ThePropertyName}}: |
||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
# set |
|||
obj.ThePropertyName = True |
obj.ThePropertyName = True |
||
# get |
|||
// get |
|||
thePropertyValue = obj.ThePropertyName |
thePropertyValue = obj.ThePropertyName |
||
}} |
}} |
||
<translate> |
<translate> |
||
<!--T:14--> |
<!--T:14--> |
||
If the type of the property is [[#App::PropertyEnumeration|App::PropertyEnumeration]], the setter has a special |
If the type of the property is [[#App::PropertyEnumeration|App::PropertyEnumeration]], the setter has a special behavior: 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: |
||
</translate> |
|||
</translate> |
|||
{{Code|code= |
{{Code|code= |
||
# allowed cases |
|||
obj.ThePropertyName = ["aaa", "bbb", "ccc"] |
obj.ThePropertyName = ["aaa", "bbb", "ccc"] |
||
# set |
|||
obj.ThePropertyName = "bbb" |
obj.ThePropertyName = "bbb" |
||
}} |
}} |
||
Line 79: | Line 90: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyAcceleration", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
== App::PropertyAmountOfSubstance == |
|||
== App::PropertyAngle == |
== App::PropertyAngle == |
||
Line 94: | Line 107: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyAngle", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = 180 |
obj.ThePropertyName = 180 |
||
obj.ThePropertyName |
obj.ThePropertyName # returns 180.0 deg |
||
obj.ThePropertyName.Value |
obj.ThePropertyName.Value # returns 180.0 |
||
}} |
}} |
||
Line 110: | Line 123: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyArea", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 125: | Line 138: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyBool", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = True |
obj.ThePropertyName = True |
||
obj.ThePropertyName = False |
obj.ThePropertyName = False |
||
obj.ThePropertyName |
obj.ThePropertyName # returns False |
||
}} |
}} |
||
Line 137: | Line 150: | ||
<translate> |
<translate> |
||
<!--T:19--> |
<!--T:19--> |
||
A property containing a list of booleans. It can contain a |
A property containing a list of booleans. It can contain a Python list of booleans, e.g. {{incode|[True, False, True]}}. For more details, see the section about [[#Creating|Creating a FeaturePython object and adding a property to it]]. |
||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyBoolList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = [True, False, True] |
obj.ThePropertyName = [True, False, True] |
||
obj.ThePropertyName |
obj.ThePropertyName # returns [True, False, True] |
||
obj.ThePropertyName[1] |
obj.ThePropertyName[1] # returns False |
||
}} |
}} |
||
Line 157: | Line 170: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyColor", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = (0.0, 1.0, 0.5, 0.8) |
obj.ThePropertyName = (0.0, 1.0, 0.5, 0.8) # (Red, Green, Blue, Transparency) |
||
obj.ThePropertyName |
obj.ThePropertyName # returns (0.0, 1.0, 0.5, 0.8) |
||
}} |
}} |
||
Line 172: | Line 185: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyColorList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
== App::PropertyCurrentDensity == |
|||
<translate> |
|||
<!--T:114--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyDensity == |
|||
== App::PropertyDirection == |
== App::PropertyDirection == |
||
<translate> |
<translate> |
||
<!--T: |
<!--T:109--> |
||
Identical to [[#App::PropertyVectorDistance|App::PropertyVectorDistance]]. |
|||
A {{TODO}}direction property. It can contain {{TODO}}"allowed type and/or values". For more details, see the section about [[#Creating|Creating a FeaturePython object and adding a property to it]]. |
|||
</translate> |
</translate> |
||
== App::PropertyDissipationRate == |
|||
{{Code|code= |
|||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
|||
<translate> |
|||
obj.Label = "User-friendly label" |
|||
<!--T:115--> |
|||
obj.addProperty('App::PropertyDirection', 'ThePropertyName', 'Subsection', 'Description for tooltip') |
|||
{{Version|0.21}} |
|||
obj.ThePropertyName = {{TODO}}"example value for setter" |
|||
</translate> |
|||
obj.ThePropertyName // returns {{TODO}}"example value for getter" |
|||
}} |
|||
== App::PropertyDistance == |
== App::PropertyDistance == |
||
Line 198: | Line 219: | ||
<translate> |
<translate> |
||
<!--T:23--> |
<!--T:23--> |
||
A distance property. It can contain a {{incode|distance}} value. |
A distance property. It can contain a positive, negative or zero {{incode|distance}} value. Use the "Value" member of the property to get the value as a float number. The value is always in mm, but in the [[Property_editor|Property editor]] is presented with units according to the preferences. For more details, see the section about [[#Creating|Creating a FeaturePython object and adding a property to it]]. |
||
<!--T:110--> |
|||
[[#App::PropertyLength|App::PropertyLength]] is a similar property that cannot contain a negative value. |
|||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyDistance", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = 500 |
obj.ThePropertyName = 500 |
||
obj.ThePropertyName |
obj.ThePropertyName # returns "500.0 mm" |
||
obj.ThePropertyName.Value |
obj.ThePropertyName.Value # returns 500.0 |
||
}} |
}} |
||
== App::PropertyDynamicViscosity == |
|||
<translate> |
|||
<!--T:116--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyElectricalCapacitance == |
|||
<translate> |
|||
<!--T:117--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyElectricalConductance == |
|||
<translate> |
|||
<!--T:118--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyElectricalConductivity == |
|||
<translate> |
|||
<!--T:119--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyElectricalInductance == |
|||
<translate> |
|||
<!--T:120--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyElectricalResistance == |
|||
<translate> |
|||
<!--T:121--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyElectricCharge == |
|||
<translate> |
|||
<!--T:122--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyElectricCurrent == |
|||
<translate> |
|||
<!--T:123--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyElectricPotential == |
|||
== App::PropertyEnumeration == |
== App::PropertyEnumeration == |
||
Line 218: | Line 300: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyEnumeration", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = ["Foo", "Bar", "Baz"] |
obj.ThePropertyName = ["Foo", "Bar", "Baz"] # set allowed items |
||
obj.ThePropertyName = "Foo" |
obj.ThePropertyName = "Foo" # choose single item |
||
obj.ThePropertyName = ["Foo", "Bar", "Quux"] |
obj.ThePropertyName = ["Foo", "Bar", "Quux"] # change allowed items |
||
obj.ThePropertyName = "Quux" |
obj.ThePropertyName = "Quux" # choose single item |
||
obj.ThePropertyName |
obj.ThePropertyName # returns "Quux" |
||
}} |
}} |
||
<translate> |
|||
<!--T:106--> |
|||
As of FreeCAD 0.20, you can also group enumerations, which are displayed in the GUI using a submenu interface. To group, use the {{incode||}} character (vertical pipe) as a separator, e.g.: |
|||
</translate> |
|||
{{Code|code= |
|||
obj.ThePropertyName = [ |
|||
"Group 1 <nowiki>|</nowiki> Item A", |
|||
"Group 1 <nowiki>|</nowiki> Item B", |
|||
"Group 2 <nowiki>|</nowiki> Another item", |
|||
"Group 2 <nowiki>|</nowiki> Last item" |
|||
] # set allowed items |
|||
obj.ThePropertyName = "Group 1 <nowiki>|</nowiki> Item A" # choose single item |
|||
}} |
|||
<translate> |
|||
<!--T:107--> |
|||
The GUI will display this as a menu structure: |
|||
* Group 1 |
|||
** Item A |
|||
** Item B |
|||
* Group 2 |
|||
** Another item |
|||
** Last item |
|||
</translate> |
|||
== App::PropertyExpressionEngine == |
== App::PropertyExpressionEngine == |
||
Line 236: | Line 344: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyExpressionEngine", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 251: | Line 359: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyFile", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 262: | Line 370: | ||
<translate> |
<translate> |
||
<!--T:27--> |
<!--T:27--> |
||
A filename property that also includes the file itself into the document. The file doesn't get loaded into memory, it gets copied from the document archive into the document transient directory. There it is accessible for reading. You can get the transient path through {{Incode|getDocTransientPath()}}. As input, the property accepts a string containing the path to the original file. The property returns the path to the temporary file in the transient directory. For more details, see this [https://github.com/FreeCAD/FreeCAD/blob/adfdbf7cd76fe78c7f818623e019454337ed1bcd/src/Mod/Arch/ArchBuildingPart.py#L595-L597 example from the Arch Workbench]. |
|||
A {{TODO}}fileIncluded property. It can contain {{TODO}}"allowed type and/or values". For more details, see the section about [[#Creating|Creating a FeaturePython object and adding a property to it]]. |
|||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyFileIncluded", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = |
obj.ThePropertyName = "D:/file.txt" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns the path to the temporary file |
||
}} |
}} |
||
Line 281: | Line 389: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyFloat", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = 15.7 |
obj.ThePropertyName = 15.7 |
||
obj.ThePropertyName |
obj.ThePropertyName # returns 15.7 |
||
}} |
}} |
||
Line 296: | Line 404: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyFloatConstraint", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = (50.0, 0.0, 100.0, 1.0) |
obj.ThePropertyName = (50.0, 0.0, 100.0, 1.0) # (Default, Start, Finish, Step) |
||
obj.ThePropertyName |
obj.ThePropertyName # returns 50.0 |
||
}} |
}} |
||
Line 311: | Line 419: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyFloatList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = [12.7, 5.8, 28.6, 17.22] |
obj.ThePropertyName = [12.7, 5.8, 28.6, 17.22] # It can also be an empty list. |
||
obj.ThePropertyName |
obj.ThePropertyName # returns [12.7, 5.8, 28.6, 17.22] |
||
}} |
}} |
||
Line 326: | Line 434: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyFont", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 341: | Line 449: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyForce", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 356: | Line 464: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyFrequency", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
== App::PropertyHeatFlux == |
|||
<translate> |
|||
<!--T:124--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyInteger == |
== App::PropertyInteger == |
||
Line 367: | Line 482: | ||
<translate> |
<translate> |
||
<!--T:34--> |
<!--T:34--> |
||
An integer property. It can contain an integer value. For more details, see the section about [[#Creating|Creating a FeaturePython object and adding a property to it]]. |
An integer property. It can contain an integer value from -2147483646 to 2147483647 included. For more details, see the section about [[#Creating|Creating a FeaturePython object and adding a property to it]]. |
||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyInteger", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = 25 |
obj.ThePropertyName = 25 |
||
obj.ThePropertyName |
obj.ThePropertyName # returns 25 |
||
}} |
}} |
||
Line 382: | Line 497: | ||
<translate> |
<translate> |
||
<!--T:35--> |
<!--T:35--> |
||
An integer constraint property. |
An integer constraint property. With this property you can set a default value, a minimum value, a maximum value and a step size. All values should be integers and can range from -2147483646 to 2147483647 included. For more details, see the section about [[#Creating|Creating a FeaturePython object and adding a property to it]]. |
||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyIntegerConstraint", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = (50, 0, 100, 1) |
obj.ThePropertyName = (50, 0, 100, 1) # (Default, Minimum, Maximum, Step size) |
||
obj.ThePropertyName |
obj.ThePropertyName # returns 50 |
||
}} |
}} |
||
Line 401: | Line 516: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyIntegerList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = [12, 5, 28, 17] |
obj.ThePropertyName = [12, 5, 28, 17] # It can also be an empty list. |
||
obj.ThePropertyName |
obj.ThePropertyName # returns [12, 5, 28, 17] |
||
}} |
}} |
||
Line 416: | Line 531: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyIntegerSet", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
== App::PropertyInverseArea == |
|||
<translate> |
|||
<!--T:125--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyInverseLength == |
|||
<translate> |
|||
<!--T:126--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyInverseVolume == |
|||
<translate> |
|||
<!--T:127--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyKinematicViscosity == |
|||
<translate> |
|||
<!--T:128--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyLength == |
== App::PropertyLength == |
||
Line 427: | Line 570: | ||
<translate> |
<translate> |
||
<!--T:38--> |
<!--T:38--> |
||
A length property. It can contain a {{incode|length}} value. |
A length property. It can contain a positive or zero {{incode|length}} value. Use the "Value" member of the property to get the value as a float number. The value is always in mm, but in the [[Property_editor|Property editor]] is presented with units according to the preferences. For more details, see the section about [[#Creating|Creating a FeaturePython object and adding a property to it]]. |
||
<!--T:111--> |
|||
[[#App::PropertyDistance|App::PropertyDistance]] is a similar property that can also contain a negative value. |
|||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyLength", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = 500 |
obj.ThePropertyName = 500 |
||
obj.ThePropertyName |
obj.ThePropertyName # returns "500.0 mm" |
||
obj.ThePropertyName.Value |
obj.ThePropertyName.Value # returns 500.0 |
||
}} |
}} |
||
Line 447: | Line 593: | ||
{{Code|code= |
{{Code|code= |
||
link_obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","LinkObjectName") |
link_obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "LinkObjectName") |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyLink", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = link_obj |
obj.ThePropertyName = link_obj |
||
obj.ThePropertyName |
obj.ThePropertyName # returns link_obj |
||
}} |
}} |
||
Line 463: | Line 609: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyLinkChild", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 478: | Line 624: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyLinkGlobal", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 493: | Line 639: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyLinkHidden", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 508: | Line 654: | ||
{{Code|code= |
{{Code|code= |
||
link_obj0=FreeCAD.ActiveDocument.addObject("App::FeaturePython","LinkObjectName0") |
link_obj0 = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "LinkObjectName0") |
||
link_obj1=FreeCAD.ActiveDocument.addObject("App::FeaturePython","LinkObjectName1") |
link_obj1 = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "LinkObjectName1") |
||
link_obj2=FreeCAD.ActiveDocument.addObject("App::FeaturePython","LinkObjectName2") |
link_obj2 = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "LinkObjectName2") |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyLinkList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = [link_obj0, link_obj1, link_obj2] |
obj.ThePropertyName = [link_obj0, link_obj1, link_obj2] |
||
obj.ThePropertyName |
obj.ThePropertyName # returns [link_obj0, link_obj1, link_obj2] |
||
}} |
}} |
||
Line 527: | Line 673: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyLinkListChild", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 542: | Line 688: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyLinkListGlobal", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 557: | Line 703: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyLinkListHidden", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 572: | Line 718: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyLinkSub", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 587: | Line 733: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyLinkSubChild", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 602: | Line 748: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyLinkSubGlobal", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 617: | Line 763: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyLinkSubHidden", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 632: | Line 778: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyLinkSubList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 647: | Line 793: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyLinkSubListChild", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 662: | Line 808: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyLinkSubListGlobal", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 677: | Line 823: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyLinkSubListHidden", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
== App::PropertyLuminousIntensity == |
|||
<translate> |
|||
<!--T:129--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyMagneticFieldStrength == |
|||
<translate> |
|||
<!--T:130--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyMagneticFlux == |
|||
<translate> |
|||
<!--T:131--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyMagneticFluxDensity == |
|||
<translate> |
|||
<!--T:132--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyMagnetization == |
|||
<translate> |
|||
<!--T:133--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyMap == |
== App::PropertyMap == |
||
Line 692: | Line 873: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyMap", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
== App::PropertyMass == |
|||
<translate> |
|||
<!--T:134--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyMaterial == |
== App::PropertyMaterial == |
||
Line 710: | Line 898: | ||
material=FreeCAD.Material() |
material=FreeCAD.Material() |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyMaterial", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = material |
obj.ThePropertyName = material |
||
obj.ThePropertyName |
obj.ThePropertyName # returns material |
||
}} |
}} |
||
Line 732: | Line 920: | ||
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyMaterialList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = [material0, material1, material2] |
obj.ThePropertyName = [material0, material1, material2] # It can also be an empty list. |
||
obj.ThePropertyName |
obj.ThePropertyName # returns [material0, material1, material2] |
||
}} |
}} |
||
Line 745: | Line 933: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyMatrix", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 760: | Line 948: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyPath", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 775: | Line 963: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyPercent", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 790: | Line 978: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyPersistentObject", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 809: | Line 997: | ||
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyPlacement", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = placement |
obj.ThePropertyName = placement |
||
obj.ThePropertyName |
obj.ThePropertyName # returns placement |
||
}} |
}} |
||
Line 822: | Line 1,010: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyPlacementLink", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 833: | Line 1,021: | ||
<translate> |
<translate> |
||
<!--T:64--> |
<!--T:64--> |
||
A |
A placement list property. It can contain list of {{incode|placements}}. For more details, see the section about [[#Creating|Creating a FeaturePython object and adding a property to it]]. |
||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
import FreeCAD |
|||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
|||
placement0 = FreeCAD.Placement() |
|||
placement1 = FreeCAD.Placement() |
|||
placement2 = FreeCAD.Placement() |
|||
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
|||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyPlacementList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = |
obj.ThePropertyName = [placement0, placement1, placement2] |
||
obj.ThePropertyName |
obj.ThePropertyName # returns [placement0, placement1, placement2] |
||
}} |
}} |
||
Line 847: | Line 1,040: | ||
<translate> |
<translate> |
||
<!--T: |
<!--T:112--> |
||
Identical to [[#App::PropertyVectorDistance|App::PropertyVectorDistance]]. |
|||
A {{TODO}}position property. It can contain {{TODO}}"allowed type and/or values". For more details, see the section about [[#Creating|Creating a FeaturePython object and adding a property to it]]. |
|||
</translate> |
</translate> |
||
== App::PropertyPower == |
|||
{{Code|code= |
|||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
|||
<translate> |
|||
obj.Label = "User-friendly label" |
|||
<!--T:135--> |
|||
obj.addProperty('App::PropertyPosition', 'ThePropertyName', 'Subsection', 'Description for tooltip') |
|||
{{Version|0.21}} |
|||
obj.ThePropertyName = {{TODO}}"example value for setter" |
|||
</translate> |
|||
obj.ThePropertyName // returns {{TODO}}"example value for getter" |
|||
}} |
|||
== App::PropertyPrecision == |
== App::PropertyPrecision == |
||
Line 867: | Line 1,059: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyPrecision", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 882: | Line 1,074: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyPressure", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 897: | Line 1,089: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyPythonObject", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 912: | Line 1,104: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyQuantity", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 927: | Line 1,119: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyQuantityConstraint", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
== App::PropertyRotation == |
|||
== App::PropertyShearModulus == |
|||
<translate> |
|||
<!--T:136--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertySpecificEnergy == |
|||
<translate> |
|||
<!--T:137--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertySpecificHeat == |
|||
<translate> |
|||
<!--T:138--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertySpeed == |
== App::PropertySpeed == |
||
Line 942: | Line 1,157: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertySpeed", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
== App::PropertyStiffness == |
|||
== App::PropertyStress == |
|||
<translate> |
|||
<!--T:139--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyString == |
== App::PropertyString == |
||
Line 957: | Line 1,181: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyString", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 972: | Line 1,196: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyStringList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
== App::PropertyTemperature == |
|||
<translate> |
|||
<!--T:140--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyThermalConductivity == |
|||
<translate> |
|||
<!--T:141--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyThermalExpansionCoefficient == |
|||
<translate> |
|||
<!--T:142--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyThermalTransferCoefficient == |
|||
<translate> |
|||
<!--T:143--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyTime == |
|||
<translate> |
|||
<!--T:144--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyUltimateTensileStrength == |
|||
<translate> |
|||
<!--T:145--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyUUID == |
== App::PropertyUUID == |
||
Line 987: | Line 1,253: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyUUID", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,002: | Line 1,268: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyVacuumPermittivity", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,013: | Line 1,279: | ||
<translate> |
<translate> |
||
<!--T:76--> |
<!--T:76--> |
||
A |
A vector property. It can contain a FreeCAD {{incode|vector}} object. The value can set by supplying a vector or a tuple. For more details, see the section about [[#Creating|Creating a FeaturePython object and adding a property to it]]. |
||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
import FreeCAD |
|||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
|||
vector = FreeCAD.Vector(0, -2, 5) |
|||
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
|||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyVector", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = |
obj.ThePropertyName = vector |
||
obj.ThePropertyName |
obj.ThePropertyName # returns Vector(0, -2, 5) |
||
obj.ThePropertyName = (1, 2, 3) |
|||
obj.ThePropertyName # returns Vector(1, 2, 3) |
|||
obj.ThePropertyName.x # returns 1.0 |
|||
obj.ThePropertyName.y # returns 2.0 |
|||
obj.ThePropertyName.z # returns 3.0 |
|||
obj.ThePropertyName.z = 6 |
|||
obj.ThePropertyName # returns Vector(1, 2, 6) |
|||
obj.ThePropertyName.Length # returns 6.4031242374328485 |
|||
obj.ThePropertyName.Length = 2 * obj.ThePropertyName.Length |
|||
obj.ThePropertyName # Vector (2.0, 4.0, 12.0) |
|||
}} |
}} |
||
Line 1,027: | Line 1,306: | ||
<translate> |
<translate> |
||
<!--T: |
<!--T:113--> |
||
A vector property that is almost identical to [[#App::PropertyVector|App::PropertyVector]]. The only difference is that in the [[Property_editor|Property editor]] the "x", "y" and "z" members of this property are presented with units according to the preferences. But internally all values are unitless and therefore in mm. |
|||
A {{TODO}}vectorDistance property. It can contain {{TODO}}"allowed type and/or values". For more details, see the section about [[#Creating|Creating a FeaturePython object and adding a property to it]]. |
|||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyVectorDistance", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = |
obj.ThePropertyName = (1, 2, 3) |
||
obj.ThePropertyName |
obj.ThePropertyName # returns Vector(1, 2, 3) |
||
obj.ThePropertyName.x # returns 1 |
|||
}} |
}} |
||
Line 1,043: | Line 1,323: | ||
<translate> |
<translate> |
||
<!--T:78--> |
<!--T:78--> |
||
A |
A vector list property. It can contain list of {{incode|vectors}}. The value can set by supplying a list of vectors and/or tuples. For more details, see the section about [[#Creating|Creating a FeaturePython object and adding a property to it]]. |
||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
import FreeCAD |
|||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
|||
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.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyVectorList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = |
obj.ThePropertyName = [v0, v1, v2, v3] |
||
obj.ThePropertyName |
obj.ThePropertyName # returns [Vector(0, 10, 0), Vector(0, 10, 0), Vector(30, -10, 0), Vector(0, -10, 0)] |
||
obj.ThePropertyName = [v0, (1, 2, 3), v2, (4, 5, 6)] |
|||
obj.ThePropertyName # returns [Vector (0, 10, 0), Vector (1, 2, 3), Vector (30, -10, 0), Vector (4, 5, 6)] |
|||
}} |
}} |
||
<translate> |
|||
<!--T:146--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyVelocity == |
|||
<translate> |
|||
<!--T:152--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyVolume == |
== App::PropertyVolume == |
||
Line 1,062: | Line 1,362: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyVolume", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
== App::PropertyVolumeFlowRate == |
|||
<translate> |
|||
<!--T:147--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyVolumetricThermalExpansionCoefficient == |
|||
<translate> |
|||
<!--T:148--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyWork == |
|||
<translate> |
|||
<!--T:149--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyXLink == |
== App::PropertyXLink == |
||
Line 1,077: | Line 1,398: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyXLink", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,092: | Line 1,413: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyXLinkList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,107: | Line 1,428: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyXLinkSub", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,122: | Line 1,443: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("App::PropertyXLinkSubList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
== App::PropertyYieldStrength == |
|||
<translate> |
|||
<!--T:150--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== App::PropertyYoungsModulus == |
|||
<translate> |
|||
<!--T:151--> |
|||
{{Version|0.21}} |
|||
</translate> |
|||
== Mesh::PropertyCurvatureList == |
== Mesh::PropertyCurvatureList == |
||
Line 1,137: | Line 1,472: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("Mesh::PropertyCurvatureList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,148: | Line 1,483: | ||
<translate> |
<translate> |
||
<!--T:85--> |
<!--T:85--> |
||
A |
A mesh kernel property. It can contain a {{incode|mesh}} object. For more details, see the section about [[#Creating|Creating a FeaturePython object and adding a property to it]]. |
||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
import Mesh |
|||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
|||
mesh = Mesh.Mesh() |
|||
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
|||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("Mesh::PropertyMeshKernel", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = |
obj.ThePropertyName = mesh |
||
obj.ThePropertyName |
obj.ThePropertyName # returns mesh |
||
}} |
}} |
||
Line 1,167: | Line 1,505: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("Mesh::PropertyNormalList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,182: | Line 1,520: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("Part::PropertyFilletEdges", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,197: | Line 1,535: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("Part::PropertyGeometryList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,208: | Line 1,546: | ||
<translate> |
<translate> |
||
<!--T:89--> |
<!--T:89--> |
||
A |
A part shape property. It can contain {{incode|shape}} object. For more details, see the section about [[#Creating|Creating a FeaturePython object and adding a property to it]]. |
||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
import Part |
|||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
|||
part = Part.Shape() |
|||
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
|||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("Part::PropertyPartShape", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = |
obj.ThePropertyName = part |
||
obj.ThePropertyName |
obj.ThePropertyName # returns part |
||
}} |
}} |
||
Line 1,227: | Line 1,568: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("Part::PropertyShapeHistory", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,242: | Line 1,583: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("Path::PropertyPath", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,257: | Line 1,598: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("Path::PropertyTool", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,272: | Line 1,613: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("Path::PropertyTooltable", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,287: | Line 1,628: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("Sketcher::PropertyConstraintList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,302: | Line 1,643: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("Spreadsheet::PropertyColumnWidths", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,317: | Line 1,658: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("Spreadsheet::PropertyRowHeights", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,332: | Line 1,673: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("Spreadsheet::PropertySheet", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,347: | Line 1,688: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("Spreadsheet::PropertySpreadsheetQuantity", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,362: | Line 1,703: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("TechDraw::PropertyCenterLineList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,377: | Line 1,718: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("TechDraw::PropertyCosmeticEdgeList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,392: | Line 1,733: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("TechDraw::PropertyCosmeticVertexList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Line 1,407: | Line 1,748: | ||
{{Code|code= |
{{Code|code= |
||
obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","InternalObjectName") |
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName") |
||
obj.Label = "User-friendly label" |
obj.Label = "User-friendly label" |
||
obj.addProperty( |
obj.addProperty("TechDraw::PropertyGeomFormatList", "ThePropertyName", "Subsection", "Description for tooltip") |
||
obj.ThePropertyName = {{TODO}}"example value for setter" |
obj.ThePropertyName = {{TODO}}"example value for setter" |
||
obj.ThePropertyName |
obj.ThePropertyName # returns {{TODO}}"example value for getter" |
||
}} |
}} |
||
Latest revision as of 20:22, 29 April 2023
Introduction
See also: Autogenerated API documentation (C++ documentation).
Properties are the true building blocks 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()
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. 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 addProperty
as shown below. FreeCAD will automatically split ThePropertyName
and display it with spaces (The Property Name
) in the Data tab of the Property editor.
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 Base
, and the tooltip is not displayed with this form.
obj.addProperty("App::PropertyBool", "ThePropertyName")
To get or set the property, use obj.ThePropertyName
:
# set
obj.ThePropertyName = True
# get
thePropertyValue = obj.ThePropertyName
If the type of the property is App::PropertyEnumeration, the setter has a special behavior: 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:
# allowed cases
obj.ThePropertyName = ["aaa", "bbb", "ccc"]
# set
obj.ThePropertyName = "bbb"
App::PropertyAcceleration
A Template:TODOacceleration property. It can contain Template:TODO"allowed type and/or values". 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::PropertyAcceleration", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyAmountOfSubstance
App::PropertyAngle
An angle property. It can contain an angle
value. You can use "Value" variable to get float variable. 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::PropertyAngle", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = 180
obj.ThePropertyName # returns 180.0 deg
obj.ThePropertyName.Value # returns 180.0
App::PropertyArea
A Template:TODOarea property. It can contain Template:TODO"allowed type and/or values". 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::PropertyArea", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyBool
A boolean property. It can contain True
and False
. 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::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. [True, False, True]
. 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::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 float
values. Each item can take values between 0.0 and 1.0. You can set red, green and blue values. Also you can set step transparency too. 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::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 Template:TODOcolorList property. It can contain Template:TODO"allowed type and/or values". 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::PropertyColorList", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyCurrentDensity
App::PropertyDensity
App::PropertyDirection
Identical to App::PropertyVectorDistance.
App::PropertyDissipationRate
App::PropertyDistance
A distance property. It can contain a positive, negative or zero distance
value. Use the "Value" member of the property to get the value as a float number. The value is always in mm, but in the Property editor is presented with units according to the preferences. For more details, see the section about Creating a FeaturePython object and adding a property to it.
App::PropertyLength is a similar property that cannot contain a negative value.
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::PropertyDynamicViscosity
App::PropertyElectricalCapacitance
App::PropertyElectricalConductance
App::PropertyElectricalConductivity
App::PropertyElectricalInductance
App::PropertyElectricalResistance
App::PropertyElectricCharge
App::PropertyElectricCurrent
App::PropertyElectricPotential
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"
As of FreeCAD 0.20, you can also group enumerations, which are displayed in the GUI using a submenu interface. To group, use the character (vertical pipe) as a separator, e.g.:
obj.ThePropertyName = [
"Group 1 | Item A",
"Group 1 | Item B",
"Group 2 | Another item",
"Group 2 | Last item"
] # set allowed items
obj.ThePropertyName = "Group 1 | Item A" # choose single item
The GUI will display this as a menu structure:
- Group 1
- Item A
- Item B
- Group 2
- Another item
- Last item
App::PropertyExpressionEngine
A Template:TODOexpressionEngine property. It can contain Template:TODO"allowed type and/or values". 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::PropertyExpressionEngine", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyFile
A filename property. It can contain a string indicating the path to a filename Template:TODO:(Does it allow relative paths or absolute paths or both?). 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::PropertyFile", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyFileIncluded
A filename property that also includes the file itself into the document. The file doesn't get loaded into memory, it gets copied from the document archive into the document transient directory. There it is accessible for reading. You can get the transient path through getDocTransientPath()
. As input, the property accepts a string containing the path to the original file. The property returns the path to the temporary file in the transient directory. For more details, see this example from the Arch Workbench.
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty("App::PropertyFileIncluded", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = "D:/file.txt"
obj.ThePropertyName # returns the path to the temporary file
App::PropertyFloat
A float property. It can contain a float
value. 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::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 float
value. By using this property you can set start and finish values. Also you can set step interval too. 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::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 float
values. 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::PropertyFloatList", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [12.7, 5.8, 28.6, 17.22] # It can also be an empty list.
obj.ThePropertyName # returns [12.7, 5.8, 28.6, 17.22]
App::PropertyFont
A Template:TODOfont property. It can contain Template:TODO"allowed type and/or values". 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::PropertyFont", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyForce
A Template:TODOforce property. It can contain Template:TODO"allowed type and/or values". 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::PropertyForce", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyFrequency
A Template:TODOfrequency property. It can contain Template:TODO"allowed type and/or values". 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::PropertyFrequency", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyHeatFlux
App::PropertyInteger
An integer property. It can contain an integer value from -2147483646 to 2147483647 included. 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::PropertyInteger", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = 25
obj.ThePropertyName # returns 25
App::PropertyIntegerConstraint
An integer constraint property. With this property you can set a default value, a minimum value, a maximum value and a step size. All values should be integers and can range from -2147483646 to 2147483647 included. 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::PropertyIntegerConstraint", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = (50, 0, 100, 1) # (Default, Minimum, Maximum, Step size)
obj.ThePropertyName # returns 50
App::PropertyIntegerList
An integer list property. It can contain list of integer
values. 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::PropertyIntegerList", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [12, 5, 28, 17] # It can also be an empty list.
obj.ThePropertyName # returns [12, 5, 28, 17]
App::PropertyIntegerSet
A Template:TODOintegerSet property. It can contain Template:TODO"allowed type and/or values". 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::PropertyIntegerSet", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyInverseArea
App::PropertyInverseLength
App::PropertyInverseVolume
App::PropertyKinematicViscosity
App::PropertyLength
A length property. It can contain a positive or zero length
value. Use the "Value" member of the property to get the value as a float number. The value is always in mm, but in the Property editor is presented with units according to the preferences. For more details, see the section about Creating a FeaturePython object and adding a property to it.
App::PropertyDistance is a similar property that can also contain a negative value.
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.0 mm"
obj.ThePropertyName.Value # returns 500.0
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 Template:TODOlinkChild property. It can contain Template:TODO"allowed type and/or values". 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::PropertyLinkChild", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyLinkGlobal
A Template:TODOlinkGlobal property. It can contain Template:TODO"allowed type and/or values". 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::PropertyLinkGlobal", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyLinkHidden
A Template:TODOlinkHidden property. It can contain Template:TODO"allowed type and/or values". 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::PropertyLinkHidden", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template: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.
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 Template:TODOlinkListChild property. It can contain Template:TODO"allowed type and/or values". 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::PropertyLinkListChild", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyLinkListGlobal
A Template:TODOlinkListGlobal property. It can contain Template:TODO"allowed type and/or values". 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::PropertyLinkListGlobal", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyLinkListHidden
A Template:TODOlinkListHidden property. It can contain Template:TODO"allowed type and/or values". 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::PropertyLinkListHidden", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyLinkSub
A Template:TODOlinkSub property. It can contain Template:TODO"allowed type and/or values". 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::PropertyLinkSub", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyLinkSubChild
A Template:TODOlinkSubChild property. It can contain Template:TODO"allowed type and/or values". 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::PropertyLinkSubChild", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyLinkSubGlobal
A Template:TODOlinkSubGlobal property. It can contain Template:TODO"allowed type and/or values". 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::PropertyLinkSubGlobal", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyLinkSubHidden
A Template:TODOlinkSubHidden property. It can contain Template:TODO"allowed type and/or values". 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::PropertyLinkSubHidden", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyLinkSubList
A Template:TODOlinkSubList property. It can contain Template:TODO"allowed type and/or values". 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::PropertyLinkSubList", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyLinkSubListChild
A Template:TODOlinkSubListChild property. It can contain Template:TODO"allowed type and/or values". 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::PropertyLinkSubListChild", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyLinkSubListGlobal
A Template:TODOlinkSubListGlobal property. It can contain Template:TODO"allowed type and/or values". 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::PropertyLinkSubListGlobal", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyLinkSubListHidden
A Template:TODOlinkSubListHidden property. It can contain Template:TODO"allowed type and/or values". 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::PropertyLinkSubListHidden", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyLuminousIntensity
App::PropertyMagneticFieldStrength
App::PropertyMagneticFlux
App::PropertyMagneticFluxDensity
App::PropertyMagnetization
App::PropertyMap
A Template:TODOmap property. It can contain Template:TODO"allowed type and/or values". 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::PropertyMap", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyMass
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.
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] # It can also be an empty list.
obj.ThePropertyName # returns [material0, material1, material2]
App::PropertyMatrix
A Template:TODOmatrix property. It can contain Template:TODO"allowed type and/or values". 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::PropertyMatrix", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyPath
A path property. It can contain a string representing a path to a folder Template:TODO:(does it also allow paths to files? does it allow relative or absolute paths or both?). 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::PropertyPath", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyPercent
A Template:TODOpercent property. It can contain Template:TODO"allowed type and/or values". 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::PropertyPercent", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyPersistentObject
A Template:TODOpersistentObject property. It can contain Template:TODO"allowed type and/or values". 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::PropertyPersistentObject", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyPlacement
A placement property. It can contain placement
object. For more details, see the section about Creating a FeaturePython object and adding a property to it.
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 Template:TODOplacementLink property. It can contain Template:TODO"allowed type and/or values". 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::PropertyPlacementLink", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyPlacementList
A placement list property. It can contain list of placements
. For more details, see the section about Creating a FeaturePython object and adding a property to it.
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
Identical to App::PropertyVectorDistance.
App::PropertyPower
App::PropertyPrecision
A Template:TODOprecision property. It can contain Template:TODO"allowed type and/or values". 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::PropertyPrecision", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyPressure
A Template:TODOpressure property. It can contain Template:TODO"allowed type and/or values". 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::PropertyPressure", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyPythonObject
A Template:TODOpythonObject property. It can contain Template:TODO"allowed type and/or values". 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::PropertyPythonObject", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyQuantity
A Template:TODOquantity property. It can contain Template:TODO"allowed type and/or values". 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::PropertyQuantity", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyQuantityConstraint
A Template:TODOquantityConstraint property. It can contain Template:TODO"allowed type and/or values". 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::PropertyQuantityConstraint", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyRotation
App::PropertyShearModulus
App::PropertySpecificEnergy
App::PropertySpecificHeat
App::PropertySpeed
A Template:TODOspeed property. It can contain Template:TODO"allowed type and/or values". 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::PropertySpeed", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyStiffness
App::PropertyStress
App::PropertyString
A Template:TODOstring property. It can contain Template:TODO"allowed type and/or values". 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::PropertyString", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyStringList
A Template:TODOstringList property. It can contain Template:TODO"allowed type and/or values". 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::PropertyStringList", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyTemperature
App::PropertyThermalConductivity
App::PropertyThermalExpansionCoefficient
App::PropertyThermalTransferCoefficient
App::PropertyTime
App::PropertyUltimateTensileStrength
App::PropertyUUID
A Template:TODOuUID property. It can contain Template:TODO"allowed type and/or values". 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::PropertyUUID", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyVacuumPermittivity
A Template:TODOvacuumPermittivity property. It can contain Template:TODO"allowed type and/or values". 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::PropertyVacuumPermittivity", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyVector
A vector property. It can contain a FreeCAD vector
object. The value can set by supplying a vector or a tuple. For more details, see the section about Creating a FeaturePython object and adding a property to it.
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)
obj.ThePropertyName = (1, 2, 3)
obj.ThePropertyName # returns Vector(1, 2, 3)
obj.ThePropertyName.x # returns 1.0
obj.ThePropertyName.y # returns 2.0
obj.ThePropertyName.z # returns 3.0
obj.ThePropertyName.z = 6
obj.ThePropertyName # returns Vector(1, 2, 6)
obj.ThePropertyName.Length # returns 6.4031242374328485
obj.ThePropertyName.Length = 2 * obj.ThePropertyName.Length
obj.ThePropertyName # Vector (2.0, 4.0, 12.0)
App::PropertyVectorDistance
A vector property that is almost identical to App::PropertyVector. The only difference is that in the Property editor the "x", "y" and "z" members of this property are presented with units according to the preferences. But internally all values are unitless and therefore in mm.
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython", "InternalObjectName")
obj.Label = "User-friendly label"
obj.addProperty("App::PropertyVectorDistance", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = (1, 2, 3)
obj.ThePropertyName # returns Vector(1, 2, 3)
obj.ThePropertyName.x # returns 1
App::PropertyVectorList
A vector list property. It can contain list of vectors
. The value can set by supplying a list of vectors and/or tuples. For more details, see the section about Creating a FeaturePython object and adding a property to it.
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)]
obj.ThePropertyName = [v0, (1, 2, 3), v2, (4, 5, 6)]
obj.ThePropertyName # returns [Vector (0, 10, 0), Vector (1, 2, 3), Vector (30, -10, 0), Vector (4, 5, 6)]
App::PropertyVelocity
App::PropertyVolume
A Template:TODOvolume property. It can contain Template:TODO"allowed type and/or values". 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::PropertyVolume", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyVolumeFlowRate
App::PropertyVolumetricThermalExpansionCoefficient
App::PropertyWork
App::PropertyXLink
A Template:TODOxLink property. It can contain Template:TODO"allowed type and/or values". 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::PropertyXLink", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyXLinkList
A Template:TODOxLinkList property. It can contain Template:TODO"allowed type and/or values". 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::PropertyXLinkList", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyXLinkSub
A Template:TODOxLinkSub property. It can contain Template:TODO"allowed type and/or values". 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::PropertyXLinkSub", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyXLinkSubList
A Template:TODOxLinkSubList property. It can contain Template:TODO"allowed type and/or values". 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::PropertyXLinkSubList", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
App::PropertyYieldStrength
App::PropertyYoungsModulus
Mesh::PropertyCurvatureList
A Template:TODOcurvatureList property. It can contain Template:TODO"allowed type and/or values". 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("Mesh::PropertyCurvatureList", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
Mesh::PropertyMeshKernel
A mesh kernel property. It can contain a mesh
object. For more details, see the section about Creating a FeaturePython object and adding a property to it.
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 Template:TODOnormalList property. It can contain Template:TODO"allowed type and/or values". 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("Mesh::PropertyNormalList", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
Part::PropertyFilletEdges
A Template:TODOfilletEdges property. It can contain Template:TODO"allowed type and/or values". 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("Part::PropertyFilletEdges", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
Part::PropertyGeometryList
A Template:TODOgeometryList property. It can contain Template:TODO"allowed type and/or values". 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("Part::PropertyGeometryList", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
Part::PropertyPartShape
A part shape property. It can contain shape
object. For more details, see the section about Creating a FeaturePython object and adding a property to it.
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 Template:TODOshapeHistory property. It can contain Template:TODO"allowed type and/or values". 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("Part::PropertyShapeHistory", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
Path::PropertyPath
A Template:TODOpath property. It can contain Template:TODO"allowed type and/or values". 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("Path::PropertyPath", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
Path::PropertyTool
A Template:TODOtool property. It can contain Template:TODO"allowed type and/or values". 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("Path::PropertyTool", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
Path::PropertyTooltable
A Template:TODOtooltable property. It can contain Template:TODO"allowed type and/or values". 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("Path::PropertyTooltable", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
Sketcher::PropertyConstraintList
A Template:TODOconstraintList property. It can contain Template:TODO"allowed type and/or values". 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("Sketcher::PropertyConstraintList", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
Spreadsheet::PropertyColumnWidths
A Template:TODOcolumnWidths property. It can contain Template:TODO"allowed type and/or values". 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("Spreadsheet::PropertyColumnWidths", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
Spreadsheet::PropertyRowHeights
A Template:TODOrowHeights property. It can contain Template:TODO"allowed type and/or values". 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("Spreadsheet::PropertyRowHeights", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
Spreadsheet::PropertySheet
A Template:TODOsheet property. It can contain Template:TODO"allowed type and/or values". 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("Spreadsheet::PropertySheet", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
Spreadsheet::PropertySpreadsheetQuantity
A Template:TODOspreadsheetQuantity property. It can contain Template:TODO"allowed type and/or values". 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("Spreadsheet::PropertySpreadsheetQuantity", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
TechDraw::PropertyCenterLineList
A Template:TODOcenterLineList property. It can contain Template:TODO"allowed type and/or values". 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("TechDraw::PropertyCenterLineList", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
TechDraw::PropertyCosmeticEdgeList
A Template:TODOcosmeticEdgeList property. It can contain Template:TODO"allowed type and/or values". 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("TechDraw::PropertyCosmeticEdgeList", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
TechDraw::PropertyCosmeticVertexList
A Template:TODOcosmeticVertexList property. It can contain Template:TODO"allowed type and/or values". 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("TechDraw::PropertyCosmeticVertexList", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
TechDraw::PropertyGeomFormatList
A Template:TODOgeomFormatList property. It can contain Template:TODO"allowed type and/or values". 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("TechDraw::PropertyGeomFormatList", "ThePropertyName", "Subsection", "Description for tooltip")
obj.ThePropertyName = [[:Template:TODO]]"example value for setter"
obj.ThePropertyName # returns [[:Template:TODO]]"example value for getter"
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework
- Hubs: User hub, Power users hub, Developer hub