Scripted objects with attachment/fr

Introduction
Le but de cette page est de montrer un exemple minimal de fonctionnalité de Part Attachement utilisant des Objets créés par script en Python.

Voir exemple minimal complet et complet ci-dessous.

Le GIF suivant montre comment attacher notre boîte personnalisée à un cylindre et mettre à jour automatiquement sa position lorsque la position du cylindre change. NOTE: The box is our custom scripted object, and the cylinder is a regular FreeCAD object generated from the Part workbench.

Add Attach Extension
First, we need to add the  extension to our   oject in the constructor, or   method, of our custom scripted object. Without adding this code, we'll see the following warning dialog when attaching our custom scripted object to another object.

Update Position Based on Attached Object
Then, in the `execute` method of our custom scripted object, we need to call the `positionBySupport` on our `Part::FeaturePython` object. Without calling, our custom scripted object won't update it's position when the position of the attached-to object changes.

Tested With the Following FreeCAD Version
Tested with the following FreeCAD version information: OS: Ubuntu 18.04.3 LTS Word size of OS: 64-bit Word size of FreeCAD: 64-bit Version: 0.18.16146 (Git) AppImage Build type: Release Branch: (HEAD detached at 0.18.4) Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8 Python version: 3.6.7 Qt version: 5.6.2 Coin version: 4.0.0a OCC version: 7.3.0 Locale: English/UnitedStates (en_US)