[python] comment accéder à la propriété support d'un sketch

Forum destiné aux questions et discussions en français
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
2cv001
Posts: 484
Joined: Wed Jan 01, 2020 9:30 am

[python] comment accéder à la propriété support d'un sketch

Post by 2cv001 »

Bonjour,
Question bête, mais je tourne en rond avec ça :
Comment en python pouvoir accéder à cette propriété attachement / support pour un Sketch :
Capture.PNG
Capture.PNG (31.12 KiB) Viewed 336 times

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.0.32258 (Git)
Build type: Release
Branch: master
Hash: 0f4acc55beb66dcc9dfab442344c6286d6a2913e
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: French/France (fr_FR)
Installed mods: 
  * Assembly3 0.11.4
  * Curves 0.6.5
  * fasteners 0.4.26
  * Help 1.0.3
  * ThreadProfile 1.84.0
Macro Sketch Constraint From Spreadsheet :
https://wiki.freecad.org/Macro_Sketch_C ... adsheet/fr
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: [python] comment accéder à la propriété support d'un sketch

Post by openBrain »

Code: Select all

App.ActiveDocument.Sketch.Support
:?:
User avatar
2cv001
Posts: 484
Joined: Wed Jan 01, 2020 9:30 am

Re: [python] comment accéder à la propriété support d'un sketch

Post by 2cv001 »

openBrain wrote: Sat Apr 01, 2023 12:11 pm

Code: Select all

App.ActiveDocument.Sketch.Support
:?:
@openBrain
Ta réponse m'a mis sur le droit chemin car il m'a permis d'aller vers la propriété support et donc de trouver la solution :

Pour mon cas, après avoir sélectionner un sketch :

Code: Select all

FreeCADGui.Selection.getSelection()[0].Support[0][0].Name
Merci @openBrain !!!!!!!!!
Macro Sketch Constraint From Spreadsheet :
https://wiki.freecad.org/Macro_Sketch_C ... adsheet/fr
Post Reply