FeaturePython Custom Properties/de

Einführung
Siehe auch: Autogenerated API documentation (C++ documentation).

Eigenschaften sind die wahren Bausteine von FeaturePython-Objekten. Durch sie wird dem Benutzer ermöglicht, mit einem Objekt zu interagieren und es zu modifizieren. Nachdem ein neues FeaturePython-Objekt im deinem Dokument erstellt wurde:

Kann man eine Liste der vorhandenen Eigenschaften erhalten, durch Eingabe von:



Ein FeaturePython-Objekt erstellen und diesem eine Eigenschaft hinzufügen
Dieser Code erstellt ein Objekt mit dem internen Namen (automatisch umbenannt in  und so weiter, wenn bereits ein Objekt mit dem Namen  existiert) und gibt ihm die benutzerfreundliche Bezeichnung. Diese Bezeichnung wird in der Baumansicht angezeigt. Ausdrücke können auf dieses Objekt über seine Bezeichnung  verweisen.

Um diesem Objekt eine Eigenschaft hinzuzufügen, wird die lange Form von verwendet, wie unten gezeigt. FreeCAD trennt (die Zeichenfolge) automatisch auf und stellt sie mit Leerzeichen  im Reiter Daten des Eigenschafteneditors dar.

ist die Art der Eigenschaft. Die unterschiedlichen Arten werden unten detaillierter beschrieben.

Es kann auch die kurze Form verwendet werden, die die letzten beiden Argumente weglässt. Standardmäßig wird der Teilabschnitt (subsection) verwendet und eine QuickInfo wird mit dieser Form nicht dargestellt.

Um die Eigenschaft aufzurufen (get) oder zu setzen (set) wird verwendet:

Ist die Art der Eigenschaft App::PropertyEnumeration, besitzt die Set-Methode ein besonderes Verhalten: Das Setzen einer liste von Zeichenketten bestimmt die Auswahlmöglichkeiten der Aufzählung (enumeration); Das Setzen einer Zeichenkette wählt eine dieser Möglichkeiten aus. Um die Liste der Wahlmöglichkeiten zu erstellen und die aktuelle festzulegen, verwendet man:

App::PropertyAcceleration
A acceleration property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyAngle
Eine Winkeleigenschaft. Sie kann einen Winkelwert  enthalten. Mit ".Value" wird der Wert als Fließkommazahl ausgegeben. Weitere Details finden sich im Abschnitt Ein FeaturePython-Objekt erstellen und diesem eine Eigenschaft hinzufügen.

App::PropertyArea
A area property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyBool
Eine boolesche Eigenschaft. Sie kann (wahr) und  (falsch) enthalten. Weitere Details finden sich im Abschnitt Ein FeaturePython-Objekt erstellen und diesem eine Eigenschaft hinzufügen.

App::PropertyBoolList
A property containing a list of booleans. It can contain a Python list of booleans, e.g. . For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyColor
Eine Farbeigenschaft. Sie kann Tupel mit vier Fließkommawerten enthalten. Jedes Element kann werte zwischen 0.0 und 1.0 enthalten. Es können Werte für Rot, Grün und Blau gesetzt werden. Zusätzlich kann ein Wert für Transparenz gesetzt werden. Weitere Details finden sich im Abschnitt Ein FeaturePython-Objekt erstellen und diesem eine Eigenschaft hinzufügen.

App::PropertyColorList
A colorList property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyDirection
Identical to App::PropertyVectorDistance.

App::PropertyDistance
A distance property. It can contain a positive, negative or zero 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.

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.

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.:

Item A",   "Group 1

The GUI will display this as a menu structure:
 * Group 1
 * Item A
 * Item B
 * Group 2
 * Another item
 * Last item

App::PropertyExpressionEngine
A expressionEngine property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyFile
A filename property. It can contain a string indicating the path to a filename :(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.

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

App::PropertyFloat
A float property. It can contain a value. For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyFloatConstraint
A float constraint property. It can contain a 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.

App::PropertyFloatList
A float list property. It can contain list of values. For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyFont
A font property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyForce
A force property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyFrequency
A frequency property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

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.

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.

App::PropertyIntegerList
An integer list property. It can contain list of values. For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyIntegerSet
A integerSet property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyLength
A length property. It can contain a positive or zero 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.

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.

App::PropertyLinkChild
A linkChild property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyLinkGlobal
A linkGlobal property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyLinkHidden
A linkHidden property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

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.

App::PropertyLinkListChild
A linkListChild property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyLinkListGlobal
A linkListGlobal property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyLinkListHidden
A linkListHidden property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyLinkSub
A linkSub property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyLinkSubChild
A linkSubChild property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyLinkSubGlobal
A linkSubGlobal property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyLinkSubHidden
A linkSubHidden property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyLinkSubList
A linkSubList property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyLinkSubListChild
A linkSubListChild property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyLinkSubListGlobal
A linkSubListGlobal property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyLinkSubListHidden
A linkSubListHidden property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyMap
A map property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

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.

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.

App::PropertyMatrix
A matrix property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyPath
A path property. It can contain a string representing a path to a folder :(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.

App::PropertyPercent
A percent property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyPersistentObject
A persistentObject property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyPlacement
A placement property. It can contain object. For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyPlacementLink
A placementLink property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

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

App::PropertyPosition
Identical to App::PropertyVectorDistance.

App::PropertyPrecision
A precision property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyPressure
A pressure property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyPythonObject
A pythonObject property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyQuantity
A quantity property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyQuantityConstraint
A quantityConstraint property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertySpeed
A speed property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyString
A string property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyStringList
A stringList property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyUUID
A uUID property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyVacuumPermittivity
A vacuumPermittivity property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyVector
A vector property. It can contain a FreeCAD 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.

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.

App::PropertyVectorList
A vector list property. It can contain list of. 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.

App::PropertyVolume
A volume property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyXLink
A xLink property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyXLinkList
A xLinkList property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyXLinkSub
A xLinkSub property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyXLinkSubList
A xLinkSubList property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

Mesh::PropertyCurvatureList
A curvatureList property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

Mesh::PropertyMeshKernel
A mesh kernel property. It can contain a object. For more details, see the section about Creating a FeaturePython object and adding a property to it.

Mesh::PropertyNormalList
A normalList property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

Part::PropertyFilletEdges
A filletEdges property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

Part::PropertyGeometryList
A geometryList property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

Part::PropertyPartShape
A part shape property. It can contain object. For more details, see the section about Creating a FeaturePython object and adding a property to it.

Part::PropertyShapeHistory
A shapeHistory property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

Path::PropertyPath
A path property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

Path::PropertyTool
A tool property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

Path::PropertyTooltable
A tooltable property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

Sketcher::PropertyConstraintList
A constraintList property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

Spreadsheet::PropertyColumnWidths
A columnWidths property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

Spreadsheet::PropertyRowHeights
A rowHeights property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

Spreadsheet::PropertySheet
A sheet property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

Spreadsheet::PropertySpreadsheetQuantity
A spreadsheetQuantity property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

TechDraw::PropertyCenterLineList
A centerLineList property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

TechDraw::PropertyCosmeticEdgeList
A cosmeticEdgeList property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

TechDraw::PropertyCosmeticVertexList
A cosmeticVertexList property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.

TechDraw::PropertyGeomFormatList
A geomFormatList property. It can contain "allowed type and/or values". For more details, see the section about Creating a FeaturePython object and adding a property to it.