FeaturePython Custom Properties/fr

Introduction
Les propriétés sont les briques de base de construction des objets FeaturePython. Grâce à eux, l'utilisateur pourra interagir et modifier son objet. Après avoir créé un nouvel objet FeaturePython dans votre document (obj=FreeCAD.ActiveDocument.addObject("App::FeaturePython","Box")), vous pouvez obtenir une liste des propriétés disponibles en tapant:

Vous obtiendrez une liste des propriétés disponibles.

Créer un objet FeaturePython et lui ajouter une propriété
Ce code créera un objet avec le nom interne (automatiquement renommé en  et ainsi de suite, si un objet nommé  existe déjà) et lui affectera l'étiquette personnalisée. Cette étiquette sera affichée dans la Vue en arborescence et la Vue combinée. Les Expressions peuvent faire référence à cet objet par son étiquette en utilisant.

Pour ajouter une propriété à cet objet, utilisez la forme longue de comme indiqué ci-dessous. FreeCAD divisera automatiquement et l'affichera avec des espaces  dans l'Onglet Données de la vue Propriété ou dans la Vue combinée.

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

Vous pouvez également utiliser la forme courte qui omet les deux derniers arguments. La sous-section a par défaut la valeur et l'infobulle n'est pas affichée avec ce formulaire.

Pour obtenir ou définir la propriété, utilisez.

Si le type de la propriété est App::PropertyEnumeration, le setter a un comportement spécial : la définition d'une liste de chaînes définit les cas autorisés par l'énumération, la définition d'une chaîne sélectionne l'un de ces cas. Pour définir la liste des cas possibles et définir le cas actuel, utilisez :

App::PropertyAcceleration
Une propriété acceleration. Elle peut contenir des "types et/ou valeurs autorisés". Pour plus de détails, voir la section Créer un objet FeaturePython et lui ajouter une propriété.

App::PropertyAngle
Une propriété d'angle. Elle peut contenir une valeur. Vous pouvez utiliser la variable "Value" pour obtenir une variable flottante. Pour plus de détails, voir la section Créer un objet FeaturePython et lui ajouter une propriété.

App::PropertyArea
Une propriété area. Elle peut contenir des "types et/ou valeurs autorisés". Pour plus de détails, voir la section sur Créer un objet FeaturePython et lui ajouter une propriété.

App::PropertyBool
Une propriété booléenne. Elle peut contenir et. Pour plus de détails, voir la section sur Créer un objet FeaturePython et lui ajouter une propriété.

App::PropertyBoolList
Une propriété contenant une liste de booléens. Elle peut contenir une liste Python de booléens, par exemple. Pour plus de détails, voir la section sur Créer un objet FeaturePython et lui ajouter une propriété.

App::PropertyColor
Une propriété de couleur. Elle peut contenir un tuple de quatre valeurs. Chaque élément peut prendre des valeurs comprises entre 0.0 et 1.0. Vous pouvez définir les valeurs rouge, verte et bleue. Vous pouvez également définir la transparence des étapes. Pour plus de détails, voir la section sur Créer un objet FeaturePython et lui ajouter une propriété.

App::PropertyColorList
Une propriété colorList. Elle peut contenir des "types et/ou valeurs autorisés". Pour plus de détails, voir la section Créer un objet FeaturePython et lui ajouter une propriété.

App::PropertyDirection
Une propriété direction. Elle peut contenir des "types et/ou valeurs autorisés". Pour plus de détails, voir la section Créer un objet FeaturePython et lui ajouter une propriété.

App::PropertyDistance
Une propriété de distance. Elle peut contenir une valeur. Vous pouvez utiliser la variable "Value" pour obtenir une variable flottante. Les valeurs doivent toujours être exprimées en millimètres. Pour plus de détails, voir la section Créer un objet FeaturePython et lui ajouter une propriété.

App::PropertyEnumeration
Une propriété de type énumération. Les éléments autorisés sont définis en donnant à la propriété la valeur d'une liste. Ensuite, elle peut contenir des éléments de la liste donnée. La liste des éléments autorisés peut être modifiée en donnant à nouveau à la propriété la valeur d'une liste. Pour plus de détails, voir la section sur Création d'un objet FeaturePython et ajout d'une propriété à celui-ci.

App::PropertyExpressionEngine
Une propriété expressionEngine. Elle peut contenir des "types et/ou valeurs autorisés". Pour plus de détails, voir la section Créer un objet FeaturePython et lui ajouter une propriété.

App::PropertyFile
Une propriété de nom de fichier. Elle peut contenir une chaîne de caractères indiquant le chemin d'accès à un nom de fichier :(autorise-t-elle les chemins relatifs ou absolus ou les deux ?). Pour plus de détails, voir la section sur Création d'un objet FeaturePython et ajout d'une propriété à celui-ci.

App::PropertyFileIncluded
Une propriété fileIncluded. Elle peut contenir des "types et/ou valeurs autorisés". Pour plus de détails, voir la section Créer un objet FeaturePython et lui ajouter une propriété.

App::PropertyFloat
Une propriété flottante. Elle peut contenir une valeur. Pour plus de détails, voir la section sur Création d'un objet FeaturePython et ajout d'une propriété à celui-ci.

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. For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyIntegerConstraint
An integer constraint property. It can contain an value. By using this property you can set start and finish values. Also you can set step interval too. 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::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 value. You can use "Value" variable to get float variable. Values always must be in millimeters unit. For more details, see the section about Creating a FeaturePython object and adding a property to it.

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
A position 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::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. For more details, see the section about Creating a FeaturePython object and adding a property to it.

App::PropertyVectorDistance
A vectorDistance 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::PropertyVectorList
A vector 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::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.